c-dsl/typedef
src/c-dsl/typedef.tur
format a single struct/union field declaration.
Example
(c-field "x" ":int") ; => "int32_t x;" (c-field "name" ":cstr") ; => "char* name;"
defn
c-field
(c-field [name : cstr type : cstr] :)
Since: P1 (return type tightened to CField in U6)
defn
c-defstruct
(c-defstruct [name : cstr fields : CField] :)
Since: P1 (variadic typed in U6)
defn
c-defunion
(c-defunion [name : cstr fields : CField] :)
Since: P1 (variadic typed in U6)
defn
c-defenum
(c-defenum [name : cstr variants : CEnumVariant] :)
Since: P1 (variadic typed in U6 extension)
defn
c-typedef
(c-typedef [type : cstr alias : cstr] :)
emit a typedef alias declaration.
Parameters
| type | original C type string (e.g. "int32_t*" or "void(*)(int32_t)") | |
| alias | new type name string |
Returns
"typedef type alias;"
Example
(c-typedef "int32_t*" "IntPtr") ; => "typedef int32_t* IntPtr;"
Since: P1
Internal definitions
__cfield-of__c-defstruct-impl-- emit a typedef struct definition.__c-defunion-impl-- emit a typedef union definition.__c-defenum-impl-- emit a typedef enum definition.