Changeset 13646
- Timestamp:
- Jun 5, 2007, 10:39:41 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsStandard.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsStandard.c
r12890 r13646 318 318 319 319 switch (concept->type) { 320 case PS_DATA_STRING: { 321 psList *regions = psStringSplit(concept->data.V, " ;", false); // List of regions 322 psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator 323 psString regionString = NULL; // Region string from iteration 324 while ((regionString = psListGetAndIncrement(regionsIter))) { 325 psRegion *region = psAlloc(sizeof(psRegion)); // The region 326 *region = psRegionFromString(regionString); 327 psListAdd(biassecs, PS_LIST_TAIL, region); 328 psFree(region); // Drop reference 329 } 330 psFree(regionsIter); 331 psFree(regions); 332 break; 333 } 334 case PS_DATA_LIST: { 320 case PS_DATA_STRING: { 321 // a single BIASSEC is of the form [AAAA] 322 // we may have multiple BIASSEC entries separated by space, commas, or semicolons 323 char *p = strchr (concept->data.V, '['); 324 while (p != NULL) { 325 char *q = strchr (p, ']'); 326 if (q == NULL) break; 327 char *regionString = psAlloc (q - p + 2); 328 strncpy (regionString, p, q - p + 1); 329 regionString[q - p + 1] = 0; 330 331 psRegion *region = psAlloc(sizeof(psRegion)); // The region 332 *region = psRegionFromString(regionString); 333 psListAdd(biassecs, PS_LIST_TAIL, region); 334 psFree(region); // Drop reference 335 psFree(regionString); // Drop reference 336 337 p = strchr (q, '['); 338 } 339 break; 340 } 341 case PS_DATA_LIST: { 335 342 psList *regions = concept->data.V; // The list of regions 336 343 psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator
Note:
See TracChangeset
for help on using the changeset viewer.
