Changeset 5950 for trunk/glueforge/templates/psdb/pop_c.tt
- Timestamp:
- Jan 6, 2006, 6:46:10 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/glueforge/templates/psdb/pop_c.tt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/glueforge/templates/psdb/pop_c.tt
r5907 r5950 7 7 int main () 8 8 { 9 psDB *dbh; 9 [% FOREACH table = tables -%] 10 { 11 psDB *dbh; 10 12 [% FOREACH item = table.columns -%] 11 13 [% IF item.type == "STR" -%] 12 [% indented("char", "$item.name[256]") %];14 [% indented("char", "$item.name[256]") %]; 13 15 [% ELSE-%] 14 [% indented("$item.ctype", "$item.name") %];16 [% indented("$item.ctype", "$item.name") %]; 15 17 [% END -%] 16 18 [% END -%] 17 19 18 dbh = psDBInit("localhost", "test", NULL, "test");19 if (!dbh) {20 exit(EXIT_FAILURE);21 }20 dbh = psDBInit("localhost", "test", NULL, "test"); 21 if (!dbh) { 22 exit(EXIT_FAILURE); 23 } 22 24 23 if (![% table.namespace %]Pop(dbh,25 if (![% table.namespace %]Pop(dbh, 24 26 [%- SET i = 0 -%] 25 27 [% FOREACH item = table.columns -%] … … 31 33 [% END -%] 32 34 [% END %])) { 33 exit(EXIT_FAILURE); 35 exit(EXIT_FAILURE); 36 } 37 38 psDBCleanup(dbh); 34 39 } 35 40 36 psDBCleanup(dbh); 37 41 [% END -%] 38 42 exit(EXIT_SUCCESS); 39 43 }
Note:
See TracChangeset
for help on using the changeset viewer.
