IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15003


Ignore:
Timestamp:
Sep 24, 2007, 6:18:00 PM (19 years ago)
Author:
jhoblitt
Message:

update magicInputSkyfile

Location:
trunk/ippdb
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.c

    r14598 r15003  
    1929319293static void magicInputSkyfileRowFree(magicInputSkyfileRow *object);
    1929419294
    19295 magicInputSkyfileRow *magicInputSkyfileRowAlloc(psS64 magic_id, psS64 diff_id, psS32 node)
     19295magicInputSkyfileRow *magicInputSkyfileRowAlloc(psS64 magic_id, psS64 diff_id, const char *node)
    1929619296{
    1929719297    magicInputSkyfileRow *_object;
     
    1930219302    _object->magic_id = magic_id;
    1930319303    _object->diff_id = diff_id;
    19304     _object->node = node;
     19304    _object->node = psStringCopy(node);
    1930519305
    1930619306    return _object;
     
    1930919309static void magicInputSkyfileRowFree(magicInputSkyfileRow *object)
    1931019310{
     19311    psFree(object->node);
    1931119312}
    1931219313
     
    1932419325        return false;
    1932519326    }
    19326     if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, "AUTO_INCREMENT INDEX(magic_id, node)", 0)) {
     19327    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, "INDEX(magic_id, node)", "64")) {
    1932719328        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
    1932819329        psFree(md);
     
    1934219343}
    1934319344
    19344 bool magicInputSkyfileInsert(psDB * dbh, psS64 magic_id, psS64 diff_id, psS32 node)
     19345bool magicInputSkyfileInsert(psDB * dbh, psS64 magic_id, psS64 diff_id, const char *node)
    1934519346{
    1934619347    psMetadata *md = psMetadataAlloc();
     
    1935519356        return false;
    1935619357    }
    19357     if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, NULL, node)) {
     19358    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, node)) {
    1935819359        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
    1935919360        psFree(md);
     
    1946619467        return false;
    1946719468    }
    19468     if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, NULL, object->node)) {
     19469    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, object->node)) {
    1946919470        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
    1947019471        psFree(md);
     
    1949019491        return false;
    1949119492    }
    19492     psS32 node = psMetadataLookupS32(&status, md, "node");
     19493    char* node = psMetadataLookupPtr(&status, md, "node");
    1949319494    if (!status) {
    1949419495        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
  • trunk/ippdb/src/ippdb.h

    r14598 r15003  
    90709070    psS64           magic_id;
    90719071    psS64           diff_id;
    9072     psS32           node;
     9072    char            *node;
    90739073} magicInputSkyfileRow;
    90749074
     
    90819081    psS64           magic_id,
    90829082    psS64           diff_id,
    9083     psS32           node
     9083    const char      *node
    90849084);
    90859085
     
    91139113    psS64           magic_id,
    91149114    psS64           diff_id,
    9115     psS32           node
     9115    const char      *node
    91169116);
    91179117
  • trunk/ippdb/tests/alloc.c

    r14598 r15003  
    21952195        magicInputSkyfileRow *object;
    21962196
    2197         object = magicInputSkyfileRowAlloc(-64, -64, -32    );
     2197        object = magicInputSkyfileRowAlloc(-64, -64, "a string"    );
    21982198
    21992199        if (!object) {
     
    22092209            exit(EXIT_FAILURE);
    22102210        }
    2211         if (!object->node == -32) {
     2211        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
    22122212            psFree(object);
    22132213            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r14598 r15003  
    613613        }
    614614
    615         if (!magicInputSkyfileInsert(dbh, -64, -64, -32)) {
     615        if (!magicInputSkyfileInsert(dbh, -64, -64, "a string")) {
    616616            exit(EXIT_FAILURE);
    617617        }
  • trunk/ippdb/tests/insertobject.c

    r14598 r15003  
    894894        }
    895895
    896         object = magicInputSkyfileRowAlloc(-64, -64, -32);
     896        object = magicInputSkyfileRowAlloc(-64, -64, "a string");
    897897        if (!object) {
    898898            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r14598 r15003  
    24522452        bool            status;
    24532453
    2454         object = magicInputSkyfileRowAlloc(-64, -64, -32);
     2454        object = magicInputSkyfileRowAlloc(-64, -64, "a string");
    24552455        if (!object) {
    24562456            exit(EXIT_FAILURE);
     
    24702470            exit(EXIT_FAILURE);
    24712471        }
    2472         if (!psMetadataLookupS32(&status, md, "node") == -32) {
     2472        if (strncmp(psMetadataLookupPtr(&status, md, "node"), "a string", MAX_STRING_LENGTH)) {
    24732473            psFree(md);
    24742474            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r14598 r15003  
    39373937            exit(EXIT_FAILURE);
    39383938        }
    3939         if (!psMetadataAddS32(md, PS_LIST_TAIL, "node", 0, NULL, -32)) {
     3939        if (!psMetadataAddStr(md, PS_LIST_TAIL, "node", 0, NULL, "a string")) {
    39403940            psFree(md);
    39413941            exit(EXIT_FAILURE);
     
    39563956            exit(EXIT_FAILURE);
    39573957        }
    3958         if (!object->node == -32) {
     3958        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
    39593959            psFree(object);
    39603960            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.