Changeset 4354
- Timestamp:
- Jun 22, 2005, 2:27:47 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/glueforge/templates/psdb/metadatafromobject_c.tt
r4332 r4354 5 5 #include <stdlib.h> 6 6 7 #define MAX_STRING_LENGTH 1024 8 7 9 int main () 8 10 { 9 11 psMetadata *md; 10 12 [% indented(object_name, "*object") %]; 13 bool status; 11 14 12 15 object = [% object_name %]Alloc( … … 25 28 } 26 29 30 psFree(object); 31 32 [% FOREACH item = columns -%] 33 [% IF item.type == "S32" or item.type == "F32" or item.type == "F64" -%] 34 if (!psMetadataLookup[% item.type %](&status, md, "[% item.name %]") == [% item.test %]) { 35 [% ELSIF item.type == "STR" -%] 36 if (strncmp(psMetadataLookupPtr(&status, md, "[% item.name %]"), [% item.test %], MAX_STRING_LENGTH)) { 37 [% ELSIF item.type == "BOOL" -%] 38 if (!psMetadataLookupBool(&status, md, "[% item.name %]") == [% item.test %]) { 39 [% END -%] 40 psFree(md); 41 exit(EXIT_FAILURE); 42 } 43 [% END -%] 44 27 45 psFree(md); 28 psFree(object);29 46 30 47 exit(EXIT_SUCCESS);
Note:
See TracChangeset
for help on using the changeset viewer.
