IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5960


Ignore:
Timestamp:
Jan 10, 2006, 12:48:48 PM (21 years ago)
Author:
jhoblitt
Message:

additional modifications and bug fixes to support multiple tables in a package

Location:
trunk/glueforge/templates/psdb
Files:
9 edited

Legend:

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

    r5907 r5960  
    1 void [% table.namespace %]Cleanup(psDB *dbh)
     1void [% pkg_namespace %]Cleanup(psDB *dbh)
    22{
    33    psDBCleanup(dbh);
  • trunk/glueforge/templates/psdb/cleanup_h.tt

    r5907 r5960  
    22 */
    33
    4 void [% table.namespace %]Cleanup(
     4void [% pkg_namespace %]Cleanup(
    55    psDB            *dbh                ///< Database handle
    66);
  • trunk/glueforge/templates/psdb/code.tt

    r5907 r5960  
    77#define MAX_STRING_LENGTH 1024
    88
     9[% INCLUDE init.tt %]
     10[% INCLUDE cleanup.tt %]
    911[% FOREACH table = tables -%]
    1012[% INCLUDE alloc.tt %]
    11 [% INCLUDE init.tt %]
    12 [% INCLUDE cleanup.tt %]
    1313[% INCLUDE createtable.tt %]
    1414[% INCLUDE droptable.tt %]
  • trunk/glueforge/templates/psdb/header.tt

    r5907 r5960  
    1111/// @{
    1212
     13[% INCLUDE init_h.tt %]
     14[% INCLUDE cleanup_h.tt %]
    1315[% FOREACH table = tables -%]
    1416[% INCLUDE object_h.tt %]
    1517[% INCLUDE alloc_h.tt %]
    16 [% INCLUDE init_h.tt %]
    17 [% INCLUDE cleanup_h.tt %]
    1818[% INCLUDE createtable_h.tt %]
    1919[% INCLUDE droptable_h.tt %]
  • trunk/glueforge/templates/psdb/init.tt

    r5907 r5960  
    1 psDB *[% table.namespace %]Init(const char *host, const char *user, const char *passwd, const char *dbname)
     1psDB *[% pkg_namespace %]Init(const char *host, const char *user, const char *passwd, const char *dbname)
    22{
    33    return psDBInit(host, user, passwd, dbname);
  • trunk/glueforge/templates/psdb/init_h.tt

    r5907 r5960  
    55 */
    66
    7 psDB *[% table.namespace %]Init(
     7psDB *[% pkg_namespace %]Init(
    88    const char      *host,              ///< Database server hostname
    99    const char      *user,              ///< Database username
  • trunk/glueforge/templates/psdb/pop.tt

    r5907 r5960  
    2020
    2121    rowSet = psDBSelectRows(dbh, [% table.namespace FILTER upper %]_TABLE_NAME, NULL, 1);
     22    if (!rowSet) {
     23        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item %s", [% table.namespace FILTER upper %]_INDEX_NAME);
     24        psFree(row);
     25        return NULL;
     26    }
     27
    2228    row = psArrayGet(rowSet, 0);
    2329    // FIXME: psArrayGet should increment the ref count
  • trunk/glueforge/templates/psdb/popfits.tt

    r5907 r5960  
    33    char            query[MAX_STRING_LENGTH];
    44
    5     if (!fooSelectRowsFits(dbh, fits, NULL, limit)) {
     5    if (![% table.namespace %]SelectRowsFits(dbh, fits, NULL, limit)) {
    66        psError(PS_ERR_UNKNOWN, true, "database error or table is empty");
    77        return false;
  • trunk/glueforge/templates/psdb/top_makefile_am.tt

    r5907 r5960  
    1111[% IF NOT loop.last -%]
    1212    $(top_builddir)/docs/man/man3/[% table.object_name %].3 \
    13 [% ELSE -%]
     13[%- ELSE -%]
    1414    $(top_builddir)/docs/man/man3/[% table.object_name %].3
    1515[% END -%]
    1616[% END %]
    1717
     18docs/man/man3/[% pkg_name %].3
    1819[%- FOREACH table = tables -%]
    19 docs/man/man3/[% pkg_name %].3 docs/man/man3/[% table.object_name %].3:
     20 docs/man/man3/[% table.object_name %].3
     21[%- IF loop.last %]:[% END -%]
     22[%- END %]
    2023        $(DOXYGEN)
    21 [%- END %]
    2224
    2325clean-local:
Note: See TracChangeset for help on using the changeset viewer.