IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2006, 3:08:30 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.16

File:
1 edited

Legend:

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

    r8156 r8161  
    7777}
    7878
     79bool ippdbPrintMetadatas(FILE *stream, psArray *mds, const char *mdname, bool mdconfigformat)
     80{
     81    PS_ASSERT_PTR_NON_NULL(mds, false);
     82    PS_ASSERT_PTR_NON_NULL(mdname, false);
     83
     84    psMetadata *output = psMetadataAlloc();
     85    for (long i = 0; i < psArrayLength(mds); i++) {
     86        psMetadata *md = mds->data[i];
     87        if (!psMetadataAddMetadata(
     88            output,
     89            PS_LIST_TAIL,
     90            mdname,
     91            PS_META_DUPLICATE_OK,
     92            NULL,
     93            md
     94        )) {
     95            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
     96            psFree(md);
     97            psFree(output);
     98            return false;
     99        }
     100        psFree(md);
     101    }
     102
     103    psString str = psMetadataConfigFormat(output);
     104    if (!str) {
     105        psError(PS_ERR_UNKNOWN, false, "failed to format data into a string");
     106        psFree(output);
     107    }
     108    psFree(output);
     109    fprintf(stream, "%s\n", str);
     110    psFree(str);
     111
     112    return true;
     113}
     114
    79115static void weatherRowFree(weatherRow *object);
    80116
Note: See TracChangeset for help on using the changeset viewer.