Download 57 The Cadvanced/Cbasic SDL to C Compiler
Transcript
Abstract Data Types This function takes the address of a variable and a type info node and releases the dynamic memory used by this value contained in the variable. Generic Make Functions There are four generic functions constructing values of structured types: extern void * GenericMakeStruct extern void * GenericMakeChoice int, void *); extern void * GenericMakeOwnRef extern void * GenericMakeArray void *); (void *, tSDLTypeInfo *, ...); (void *, tSDLTypeInfo *, (tSDLTypeInfo *, void *); (void *, tSDLTypeInfo *, GenericMakeStruct: According to SDL, the Make operator is only available for the struct type. However, in the SDL suite the Make operator, and thus the GenericMakeStruct function, is also available for the Object_identifier type and the instantiations of the generators string, powerset, and bag. • The void * parameter is the address of a variable where the result should be placed. This value is also returned. • The tSDLTypeInfo * parameter is the address to the type info node for the type to be created. • “...” denotes a list of addresses to the values for the components in the struct. All parameters must be passed as addresses (void *) regardless if the component type should be passed as an address or as a value. The only exceptions are the types represented as pointers themselves (Charstring, Ref, Own, ORef, and syntypes of these types), where the pointers are passed, not the addresses of the pointers. In case of an optional field or a field with an initializer, a ‘0’ or ’1’ is passed to indicate if a value for the component is present or not. If ‘1’ is passed the value follows as next parameter. If ‘0’ is passed no value is present in the actual parameter list. GenericMakeChoice: This function is used for choice types. July 2003 • The first void * parameter is the address of a variable where the result should be placed. This value is also returned. • The tSDLTypeInfo * parameter is the address to the type info node for the type to be created. • The int parameter decides which choice component that is present. Telelogic Tau 4.5 User’s Manual ,um-st1 2629