IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 5, 2006, 2:16:35 PM (21 years ago)
Author:
jhoblitt
Message:

split global and per table data
forward port generated code to pslib 0.9.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/templates/psdb/alloc.tt

    r4196 r5907  
    11[% USE format -%]
    22[% indented = format('%-15s %s') -%]
    3 static void [% object_name %]Free([% object_name %] *object);
     3static void [% table.object_name %]Free([% table.object_name %] *object);
    44
    5 [% object_name %] *[% object_name %]Alloc(
     5[% table.object_name %] *[% table.object_name %]Alloc(
    66[%- SET i = 0 -%]
    7 [% FOREACH item = columns -%]
     7[% FOREACH item = table.columns -%]
    88[% IF i == 0 %][% i = 1 %][% ELSE %], [% END -%]
    99[% IF item.type == "STR" -%]
     
    1515)
    1616{
    17     [% indented(object_name, "*object") %];
     17    [% indented(table.object_name, "*object") %];
    1818
    19     object = psAlloc(sizeof([% object_name %]));
    20     psMemSetDeallocator(object, (psFreeFcn)[% object_name %]Free);
     19    object = psAlloc(sizeof([% table.object_name %]));
     20    psMemSetDeallocator(object, (psFreeFunc)[% table.object_name %]Free);
    2121
    22 [% FOREACH item = columns -%]
     22[% FOREACH item = table.columns -%]
    2323[% IF item.type == "STR" -%]
    2424    object->[% item.name %] = psStringCopy([% item.name %]);
     
    3131}
    3232
    33 static void [% object_name %]Free([% object_name %] *object)
     33static void [% table.object_name %]Free([% table.object_name %] *object)
    3434{
    35 [% FOREACH item = columns -%]
     35[% FOREACH item = table.columns -%]
    3636[% IF item.type == "STR" -%]
    3737    psFree(object->[% item.name %]);
Note: See TracChangeset for help on using the changeset viewer.