This structure defines how external signature information is represented and provides operators for manipulating this information.
c_typeType abbreviation
type c_type
Type.c_type.
Type abbreviation
type c_signature
Datatype
datatype c_decl = UNDEF_DECL | VAR_DECL of { name : name, ctype : c_type } | FUN_DECL of { name : name, source : c_type list, target : c_type } | TYPE_DECL of { name : name, defn : c_type, size : int } | CONST_DECL of { name : name, ctype : c_type }
UNDEF_DECL This value is included as a default return value for queries rather than using option values (that is, NONE and SOME) for wrapping and unwrapping these values.
VAR_DECL of { name : name, ctype : c_type } FUN_DECL of { name : name, source : c_type list, target : c_type } TYPE_DECL of { name : name, defn : c_type, size : int } typedef and struct/union/enum declarations) can be recorded in this form. The associated type and size information may be updated and modified.
CONST_DECL of { name : name, ctype : c_type } #define constants can be recorded in this form.
Function
val newSignature : unit -> c_signature
c_signature object.
Function
val lookupEntry : c_signature -> name -> c_decl
c_signature and a name and returns a declaration value having that name, if one exists.
Function
val defEntry : c_signature * c_decl -> unit
c_signature object by adding a given entry.
Function
val removeEntry : c_signature * name -> unit
c_signature object.
Function
val showEntries : c_signature -> c_decl list
c_signature.
Function
val normaliseType : c_signature -> (c_type -> c_type)
c_type object and ensures that size information is correct and up to date. Normalised types can have their sizes computed using sizeOf. See page 253.