IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7016


Ignore:
Timestamp:
Apr 30, 2006, 3:08:45 PM (20 years ago)
Author:
magnier
Message:

fixed instances of psStringSplit to use new API

Location:
trunk/psModules/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmConceptsRead.c

    r6983 r7016  
    216216                if (mdok && strlen(keywords) > 0) {
    217217                    // In case there are multiple headers
    218                     psList *keys = psStringSplit(keywords, " ,;"); // List of keywords
     218                    psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords
    219219                    if (keys->n == 1) {
    220220                        // Only one key --- proceed as usual
     
    285285                // Now, need to get the "given"s
    286286                if (strlen(givenCols) > 0 || strlen(givenPS) > 0) {
    287                     psList *cols = psStringSplit(givenCols, ",;"); // List of column names
    288                     psList *values = psStringSplit(givenPS, ",;"); // List of value names for the columns
     287                    psList *cols = psStringSplit(givenCols, ",;", true); // List of column names
     288                    psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns
    289289                    psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB
    290290                    if (cols->n != values->n) {
     
    516516        // Now, need to get the "given"s
    517517        if (strlen(givenCols) || strlen(givenPS)) {
    518             psList *cols = psStringSplit(givenCols, ",;"); // List of column names
    519             psList *values = psStringSplit(givenPS, ",;"); // List of value names for the columns
     518            psList *cols = psStringSplit(givenCols, ",;", true); // List of column names
     519            psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns
    520520            psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB
    521521            if (cols->n != values->n) {
  • trunk/psModules/src/astrom/pmConceptsStandard.c

    r6895 r7016  
    177177    switch (concept->type) {
    178178    case PS_DATA_STRING: {
    179             psList *regions = psStringSplit(concept->data.V, " ;"); // List of regions
     179            psList *regions = psStringSplit(concept->data.V, " ;", true); // List of regions
    180180            psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator
    181181            psString regionString = NULL; // Region string from iteration
     
    569569        // We're working with two separate headers --- construct a list with the date and time separately
    570570        psString dateTimeString = psTimeToISO(time); // String representation
    571         psList *dateTime = psStringSplit(dateTimeString, "T");
     571        psList *dateTime = psStringSplit(dateTimeString, "T", true);
    572572        psFree(dateTimeString);
    573573        psString dateString = psListGet(dateTime, PS_LIST_HEAD); // The date string
  • trunk/psModules/src/astrom/pmConceptsWrite.c

    r6955 r7016  
    3535        switch (standard->type) {
    3636        case PS_DATA_STRING:
    37             sList = psStringSplit(standard->data.V, " ;");
     37            sList = psStringSplit(standard->data.V, " ;", true);
    3838            break;
    3939        case PS_DATA_LIST:
     
    173173            return false;
    174174        }
    175         psList *keys = psStringSplit(keywords, " ,;"); // List of keywords
     175        psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords
    176176        if (keys->n != values->n) {
    177177            psLogMsg(__func__, PS_LOG_WARN, "Number of keywords (%d) does not match number of values (%d).\n",
     
    363363                    continue;
    364364                }
    365                 psList *keywords = psStringSplit(headerItem->data.V, " ,;"); // List of header keywords
     365                psList *keywords = psStringSplit(headerItem->data.V, " ,;", true); // List of header keywords
    366366                if (formatted->type == PS_DATA_LIST) {
    367367                    psList *values = formatted->data.V; // The values for the headers
     
    448448                // Now, need to get the "given"s
    449449                if (strlen(givenCols) || strlen(givenPS)) {
    450                     psList *cols = psStringSplit(givenCols, ",;"); // List of column names
    451                     psList *values = psStringSplit(givenPS, ",;"); // List of value names for the columns
     450                    psList *cols = psStringSplit(givenCols, ",;", true); // List of column names
     451                    psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns
    452452                    psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB
    453453                    if (cols->n != values->n) {
     
    708708        // Now, need to get the "given"s
    709709        if (strlen(givenCols) || strlen(givenPS)) {
    710             psList *cols = psStringSplit(givenCols, ",;"); // List of column names
    711             psList *values = psStringSplit(givenPS, ",;"); // List of value names for the columns
     710            psList *cols = psStringSplit(givenCols, ",;", true); // List of column names
     711            psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns
    712712            psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB
    713713            if (cols->n != values->n) {
  • trunk/psModules/src/astrom/pmFPAConceptsGet.c

    r6872 r7016  
    163163        // Now, need to get the "given"s
    164164        if (strlen(givenCols) || strlen(givenPS)) {
    165             psList *cols = psStringSplit(givenCols, ",;"); // List of column names
    166             psList *values = psStringSplit(givenPS, ",;"); // List of value names for the columns
     165            psList *cols = psStringSplit(givenCols, ",;", true); // List of column names
     166            psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns
    167167            psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB
    168168            if (cols->n != values->n) {
     
    723723                psString source = sourceItem->data.V; // The source string
    724724
    725                 psList *secList = psStringSplit(sections, " ;"); // List of sections
     725                psList *secList = psStringSplit(sections, " ;", true); // List of sections
    726726                psListIterator *secIter = psListIteratorAlloc(secList, PS_LIST_HEAD, false); // Iterator over
    727727                // sections
  • trunk/psModules/src/astrom/pmFPAConceptsSet.c

    r6872 r7016  
    249249        // Now, need to get the "given"s
    250250        if (strlen(givenCols) || strlen(givenPS)) {
    251             psList *cols = psStringSplit(givenCols, ",;"); // List of column names
    252             psList *values = psStringSplit(givenPS, ",;"); // List of value names for the columns
     251            psList *cols = psStringSplit(givenCols, ",;", true); // List of column names
     252            psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns
    253253            psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB
    254254            if (cols->n != values->n) {
     
    617617                // Check that it's the same value as stored in the camera
    618618                psString checkString = psMetadataLookupStr(NULL, cell->camera, "CELL.BIASSEC");
    619                 psList *checkList = psStringSplit(checkString, " ;");
     619                psList *checkList = psStringSplit(checkString, " ;", true);
    620620                if (biassecs->n != checkList->n) {
    621621                    psError(PS_ERR_IO, true, "Target CELL.BIASSEC is specified by value, but number of "
     
    663663            } else if (strcasecmp(source, "HEADER") == 0) {
    664664                psString keywordsString = psMetadataLookupStr(NULL, cell->camera, "CELL.BIASSEC");
    665                 psList *keywords = psStringSplit(keywordsString, " ,;");
     665                psList *keywords = psStringSplit(keywordsString, " ,;", true);
    666666                if (biassecs->n != keywords->n) {
    667667                    psError(PS_ERR_IO, true, "Target CELL.BIASSEC is sepcified by headers, but the number "
     
    825825                    psMetadata *translation = psMetadataLookupMD(NULL, camera, "TRANSLATION");
    826826                    psString keywords = psMetadataLookupStr(NULL, translation, "CELL.TIME");
    827                     psList *dateTimeKeywords = psStringSplit(keywords, " ,;");
     827                    psList *dateTimeKeywords = psStringSplit(keywords, " ,;", true);
    828828                    psString dateKeyword = psListGet(dateTimeKeywords, PS_LIST_HEAD);
    829829                    psString timeKeyword = psListGet(dateTimeKeywords, PS_LIST_TAIL);
    830830
    831                     psList *dateTime = psStringSplit(dateTimeString, " T"); // Find the middle T
     831                    psList *dateTime = psStringSplit(dateTimeString, " T", true); // Find the middle T
    832832                    psString dateString = psListGet(dateTime, PS_LIST_HEAD);
    833833                    psString timeString = psListGet(dateTime, PS_LIST_TAIL);
  • trunk/psModules/src/astrom/pmFPAConstruct.c

    r7009 r7016  
    4343{
    4444    bool allOK = true;                  // Everything was OK?
    45     psList *values = psStringSplit(string, " ,;"); // List of the parts
     45    psList *values = psStringSplit(string, " ,;", true); // List of the parts
    4646    *first = psArrayAlloc(values->n);
    4747    *second = psArrayAlloc(values->n);
     
    5252    psString value = NULL;               // "first:second:third" string
    5353    while ((value = psListGetAndIncrement(valuesIter))) {
    54         psList *firstSecondThird = psStringSplit(value, ":"); // List containing the first, second, third
     54        psList *firstSecondThird = psStringSplit(value, ":", true); // List containing the first, second, third
    5555        psArray *fst = psListToArray(firstSecondThird); // An array representation
    5656        psFree(firstSecondThird);
     
    194194    }
    195195
    196     psList *keywords = psStringSplit(contentHeaders, " ,;"); // List of keywords
     196    psList *keywords = psStringSplit(contentHeaders, " ,;", true); // List of keywords
    197197    psListIterator *keywordsIter = psListIteratorAlloc(keywords, PS_LIST_HEAD, false); // Iterator
    198198    psString keyword = NULL;        // Keyword, from iteration
     
    377377
    378378        pmChip *chip = pmChipAlloc(fpa, chipName); // The chip
    379         psList *cellNames = psStringSplit(componentsItem->data.V, " ,;"); // List of cell names
     379        psList *cellNames = psStringSplit(componentsItem->data.V, " ,;", true); // List of cell names
    380380        psListIterator *cellNamesIter = psListIteratorAlloc(cellNames, PS_LIST_HEAD, false); // Iterator
    381381
  • trunk/psModules/src/astrom/pmFPA_JPEG.c

    r6872 r7016  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-04-17 18:01:04 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-05-01 01:08:45 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    123123        mode = pmFPAfileNameFromRule (file->extrule, file, view);
    124124        word = pmFPAfileNameFromRule (file->extxtra, file, view);
    125         range = psStringSplitArray (word, ":");
     125        range = psStringSplitArray (word, ":", false);
    126126
    127127        // XXX we need to decide where the scale will come from in the long term
  • trunk/psModules/src/config/pmConfig.c

    r6955 r7016  
    33 *  @author PAP, IfA
    44 *
    5  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-04-22 03:20:16 $
     5 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-05-01 01:08:45 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    219219    char *path = psMetadataLookupStr(NULL, config->site, "PATH");
    220220    if (path) {
    221         psList *list = psStringSplit(path, ":");
     221        psList *list = psStringSplit(path, ":", false);
    222222        configPath = psListToArray(list);
    223223        psFree(list);
  • trunk/psModules/src/objects/pmSourceIO_CMP.c

    r7012 r7016  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-04-30 22:08:33 $
     5 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-05-01 01:08:45 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    215215            psString line = psStringNCopy (&buffer[j*BYTES_STAR], BYTES_STAR);
    216216
    217             // XXX this is failing on lines where there are multiple spaces in a row
    218             psList *list = psStringSplit (line, " ");
     217            psList *list = psStringSplit (line, " ", false);
    219218            psArray *array = psListToArray (list);
    220219
  • trunk/psModules/src/pslib/psAdditionals.c

    r6956 r7016  
    1616}
    1717
    18 psArray *psStringSplitArray (const char *string, const char *splitters)
     18psArray *psStringSplitArray (const char *string, const char *splitters, bool multi)
    1919{
    2020
    21     psList *list = psStringSplit (string, splitters);
     21    psList *list = psStringSplit (string, splitters, multi);
    2222    psArray *array = psListToArray (list);
    2323    psFree (list);
  • trunk/psModules/src/pslib/psAdditionals.h

    r6956 r7016  
    1515// Split string on given characters
    1616psArray *psStringSplitArray(const char *string, // String to split
    17                             const char *splitters // Characters on which to split
    18                            );
     17                            const char *splitters, // Characters on which to split
     18                            bool multipleAreSignificant);
    1919
    2020// strip whitespace from head and tail of string
Note: See TracChangeset for help on using the changeset viewer.