; generate declarations for structures (in-package "VERRAZANO-CFFI") ; for structures, output defcstruct declaration (generate-for ((par namespace-type) (edg defines) (tgt struct-type)) (let ((struct-name (named-name tgt))) (define-symbol struct-name "structure") (defcstruct-declaration struct-name tgt))) ; for member variables, output tuple (generate-for ((par struct-type) (edg allocates) (tgt cpp-type)) (member-tuple-declaration (named-name edg) tgt)) ; don't generate anything for default constructors (generate-for ((par struct-type) (edg allocates) (tgt function-type)) nil) ; for unions, output defcunion declaration (generate-for ((par namespace-type) (edg defines) (tgt union-type)) (let ((union-name (named-name tgt))) (define-symbol union-name "union") (defcunion-declaration union-name tgt))) ; for member variables, output tuple (generate-for ((par union-type) (edg allocates) (tgt cpp-type)) (member-tuple-declaration (named-name edg) tgt)) ; ignore member functions for unions (generate-for ((par union-type) (edg allocates) (tgt function-type)) nil)