Changeset 7016
- Timestamp:
- Apr 30, 2006, 3:08:45 PM (20 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 11 edited
-
astrom/pmConceptsRead.c (modified) (3 diffs)
-
astrom/pmConceptsStandard.c (modified) (2 diffs)
-
astrom/pmConceptsWrite.c (modified) (5 diffs)
-
astrom/pmFPAConceptsGet.c (modified) (2 diffs)
-
astrom/pmFPAConceptsSet.c (modified) (4 diffs)
-
astrom/pmFPAConstruct.c (modified) (4 diffs)
-
astrom/pmFPA_JPEG.c (modified) (2 diffs)
-
config/pmConfig.c (modified) (2 diffs)
-
objects/pmSourceIO_CMP.c (modified) (2 diffs)
-
pslib/psAdditionals.c (modified) (1 diff)
-
pslib/psAdditionals.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmConceptsRead.c
r6983 r7016 216 216 if (mdok && strlen(keywords) > 0) { 217 217 // In case there are multiple headers 218 psList *keys = psStringSplit(keywords, " ,;" ); // List of keywords218 psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords 219 219 if (keys->n == 1) { 220 220 // Only one key --- proceed as usual … … 285 285 // Now, need to get the "given"s 286 286 if (strlen(givenCols) > 0 || strlen(givenPS) > 0) { 287 psList *cols = psStringSplit(givenCols, ",;" ); // List of column names288 psList *values = psStringSplit(givenPS, ",;" ); // List of value names for the columns287 psList *cols = psStringSplit(givenCols, ",;", true); // List of column names 288 psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns 289 289 psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB 290 290 if (cols->n != values->n) { … … 516 516 // Now, need to get the "given"s 517 517 if (strlen(givenCols) || strlen(givenPS)) { 518 psList *cols = psStringSplit(givenCols, ",;" ); // List of column names519 psList *values = psStringSplit(givenPS, ",;" ); // List of value names for the columns518 psList *cols = psStringSplit(givenCols, ",;", true); // List of column names 519 psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns 520 520 psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB 521 521 if (cols->n != values->n) { -
trunk/psModules/src/astrom/pmConceptsStandard.c
r6895 r7016 177 177 switch (concept->type) { 178 178 case PS_DATA_STRING: { 179 psList *regions = psStringSplit(concept->data.V, " ;" ); // List of regions179 psList *regions = psStringSplit(concept->data.V, " ;", true); // List of regions 180 180 psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator 181 181 psString regionString = NULL; // Region string from iteration … … 569 569 // We're working with two separate headers --- construct a list with the date and time separately 570 570 psString dateTimeString = psTimeToISO(time); // String representation 571 psList *dateTime = psStringSplit(dateTimeString, "T" );571 psList *dateTime = psStringSplit(dateTimeString, "T", true); 572 572 psFree(dateTimeString); 573 573 psString dateString = psListGet(dateTime, PS_LIST_HEAD); // The date string -
trunk/psModules/src/astrom/pmConceptsWrite.c
r6955 r7016 35 35 switch (standard->type) { 36 36 case PS_DATA_STRING: 37 sList = psStringSplit(standard->data.V, " ;" );37 sList = psStringSplit(standard->data.V, " ;", true); 38 38 break; 39 39 case PS_DATA_LIST: … … 173 173 return false; 174 174 } 175 psList *keys = psStringSplit(keywords, " ,;" ); // List of keywords175 psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords 176 176 if (keys->n != values->n) { 177 177 psLogMsg(__func__, PS_LOG_WARN, "Number of keywords (%d) does not match number of values (%d).\n", … … 363 363 continue; 364 364 } 365 psList *keywords = psStringSplit(headerItem->data.V, " ,;" ); // List of header keywords365 psList *keywords = psStringSplit(headerItem->data.V, " ,;", true); // List of header keywords 366 366 if (formatted->type == PS_DATA_LIST) { 367 367 psList *values = formatted->data.V; // The values for the headers … … 448 448 // Now, need to get the "given"s 449 449 if (strlen(givenCols) || strlen(givenPS)) { 450 psList *cols = psStringSplit(givenCols, ",;" ); // List of column names451 psList *values = psStringSplit(givenPS, ",;" ); // List of value names for the columns450 psList *cols = psStringSplit(givenCols, ",;", true); // List of column names 451 psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns 452 452 psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB 453 453 if (cols->n != values->n) { … … 708 708 // Now, need to get the "given"s 709 709 if (strlen(givenCols) || strlen(givenPS)) { 710 psList *cols = psStringSplit(givenCols, ",;" ); // List of column names711 psList *values = psStringSplit(givenPS, ",;" ); // List of value names for the columns710 psList *cols = psStringSplit(givenCols, ",;", true); // List of column names 711 psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns 712 712 psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB 713 713 if (cols->n != values->n) { -
trunk/psModules/src/astrom/pmFPAConceptsGet.c
r6872 r7016 163 163 // Now, need to get the "given"s 164 164 if (strlen(givenCols) || strlen(givenPS)) { 165 psList *cols = psStringSplit(givenCols, ",;" ); // List of column names166 psList *values = psStringSplit(givenPS, ",;" ); // List of value names for the columns165 psList *cols = psStringSplit(givenCols, ",;", true); // List of column names 166 psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns 167 167 psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB 168 168 if (cols->n != values->n) { … … 723 723 psString source = sourceItem->data.V; // The source string 724 724 725 psList *secList = psStringSplit(sections, " ;" ); // List of sections725 psList *secList = psStringSplit(sections, " ;", true); // List of sections 726 726 psListIterator *secIter = psListIteratorAlloc(secList, PS_LIST_HEAD, false); // Iterator over 727 727 // sections -
trunk/psModules/src/astrom/pmFPAConceptsSet.c
r6872 r7016 249 249 // Now, need to get the "given"s 250 250 if (strlen(givenCols) || strlen(givenPS)) { 251 psList *cols = psStringSplit(givenCols, ",;" ); // List of column names252 psList *values = psStringSplit(givenPS, ",;" ); // List of value names for the columns251 psList *cols = psStringSplit(givenCols, ",;", true); // List of column names 252 psList *values = psStringSplit(givenPS, ",;", true); // List of value names for the columns 253 253 psMetadata *selection = psMetadataAlloc(); // The stuff to select in the DB 254 254 if (cols->n != values->n) { … … 617 617 // Check that it's the same value as stored in the camera 618 618 psString checkString = psMetadataLookupStr(NULL, cell->camera, "CELL.BIASSEC"); 619 psList *checkList = psStringSplit(checkString, " ;" );619 psList *checkList = psStringSplit(checkString, " ;", true); 620 620 if (biassecs->n != checkList->n) { 621 621 psError(PS_ERR_IO, true, "Target CELL.BIASSEC is specified by value, but number of " … … 663 663 } else if (strcasecmp(source, "HEADER") == 0) { 664 664 psString keywordsString = psMetadataLookupStr(NULL, cell->camera, "CELL.BIASSEC"); 665 psList *keywords = psStringSplit(keywordsString, " ,;" );665 psList *keywords = psStringSplit(keywordsString, " ,;", true); 666 666 if (biassecs->n != keywords->n) { 667 667 psError(PS_ERR_IO, true, "Target CELL.BIASSEC is sepcified by headers, but the number " … … 825 825 psMetadata *translation = psMetadataLookupMD(NULL, camera, "TRANSLATION"); 826 826 psString keywords = psMetadataLookupStr(NULL, translation, "CELL.TIME"); 827 psList *dateTimeKeywords = psStringSplit(keywords, " ,;" );827 psList *dateTimeKeywords = psStringSplit(keywords, " ,;", true); 828 828 psString dateKeyword = psListGet(dateTimeKeywords, PS_LIST_HEAD); 829 829 psString timeKeyword = psListGet(dateTimeKeywords, PS_LIST_TAIL); 830 830 831 psList *dateTime = psStringSplit(dateTimeString, " T" ); // Find the middle T831 psList *dateTime = psStringSplit(dateTimeString, " T", true); // Find the middle T 832 832 psString dateString = psListGet(dateTime, PS_LIST_HEAD); 833 833 psString timeString = psListGet(dateTime, PS_LIST_TAIL); -
trunk/psModules/src/astrom/pmFPAConstruct.c
r7009 r7016 43 43 { 44 44 bool allOK = true; // Everything was OK? 45 psList *values = psStringSplit(string, " ,;" ); // List of the parts45 psList *values = psStringSplit(string, " ,;", true); // List of the parts 46 46 *first = psArrayAlloc(values->n); 47 47 *second = psArrayAlloc(values->n); … … 52 52 psString value = NULL; // "first:second:third" string 53 53 while ((value = psListGetAndIncrement(valuesIter))) { 54 psList *firstSecondThird = psStringSplit(value, ":" ); // List containing the first, second, third54 psList *firstSecondThird = psStringSplit(value, ":", true); // List containing the first, second, third 55 55 psArray *fst = psListToArray(firstSecondThird); // An array representation 56 56 psFree(firstSecondThird); … … 194 194 } 195 195 196 psList *keywords = psStringSplit(contentHeaders, " ,;" ); // List of keywords196 psList *keywords = psStringSplit(contentHeaders, " ,;", true); // List of keywords 197 197 psListIterator *keywordsIter = psListIteratorAlloc(keywords, PS_LIST_HEAD, false); // Iterator 198 198 psString keyword = NULL; // Keyword, from iteration … … 377 377 378 378 pmChip *chip = pmChipAlloc(fpa, chipName); // The chip 379 psList *cellNames = psStringSplit(componentsItem->data.V, " ,;" ); // List of cell names379 psList *cellNames = psStringSplit(componentsItem->data.V, " ,;", true); // List of cell names 380 380 psListIterator *cellNamesIter = psListIteratorAlloc(cellNames, PS_LIST_HEAD, false); // Iterator 381 381 -
trunk/psModules/src/astrom/pmFPA_JPEG.c
r6872 r7016 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-0 4-17 18:01:04$7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-05-01 01:08:45 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 123 123 mode = pmFPAfileNameFromRule (file->extrule, file, view); 124 124 word = pmFPAfileNameFromRule (file->extxtra, file, view); 125 range = psStringSplitArray (word, ":" );125 range = psStringSplitArray (word, ":", false); 126 126 127 127 // XXX we need to decide where the scale will come from in the long term -
trunk/psModules/src/config/pmConfig.c
r6955 r7016 3 3 * @author PAP, IfA 4 4 * 5 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 4-22 03:20:16$5 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-05-01 01:08:45 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 219 219 char *path = psMetadataLookupStr(NULL, config->site, "PATH"); 220 220 if (path) { 221 psList *list = psStringSplit(path, ":" );221 psList *list = psStringSplit(path, ":", false); 222 222 configPath = psListToArray(list); 223 223 psFree(list); -
trunk/psModules/src/objects/pmSourceIO_CMP.c
r7012 r7016 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 4-30 22:08:33$5 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-05-01 01:08:45 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 215 215 psString line = psStringNCopy (&buffer[j*BYTES_STAR], BYTES_STAR); 216 216 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); 219 218 psArray *array = psListToArray (list); 220 219 -
trunk/psModules/src/pslib/psAdditionals.c
r6956 r7016 16 16 } 17 17 18 psArray *psStringSplitArray (const char *string, const char *splitters )18 psArray *psStringSplitArray (const char *string, const char *splitters, bool multi) 19 19 { 20 20 21 psList *list = psStringSplit (string, splitters );21 psList *list = psStringSplit (string, splitters, multi); 22 22 psArray *array = psListToArray (list); 23 23 psFree (list); -
trunk/psModules/src/pslib/psAdditionals.h
r6956 r7016 15 15 // Split string on given characters 16 16 psArray *psStringSplitArray(const char *string, // String to split 17 const char *splitters // Characters on which to split18 );17 const char *splitters, // Characters on which to split 18 bool multipleAreSignificant); 19 19 20 20 // strip whitespace from head and tail of string
Note:
See TracChangeset
for help on using the changeset viewer.
