Changeset 17391
- Timestamp:
- Apr 8, 2008, 8:26:00 AM (18 years ago)
- Location:
- branches/eam_branch_20080408/psLib/src/types
- Files:
-
- 2 edited
-
psMetadata.c (modified) (2 diffs)
-
psMetadataConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080408/psLib/src/types/psMetadata.c
r16814 r17391 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.168 $ $Name: not supported by cvs2svn $15 * @date $Date: 2008-0 3-05 00:57:00 $14 * @version $Revision: 1.168.2.1 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2008-04-08 18:26:00 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 498 498 psMetadataItem *inItem = NULL; 499 499 while ((inItem = psMetadataGetAndIncrement(iter))) { 500 501 // XXX options: 502 // input MULTI & RESET : replace an existing MULTI or ITEM of same name 503 // input MULTI & UPDATE : supplement an existing MULTI or ITEM of same name 504 // in both cases the name must exist in 'out' 505 506 // XXX we can meet this condition by respecting the value of 507 // XXX do we need to do something special if the existing item is not MULTI? 508 500 509 // Need to look for MULTI, which won't be picked up using the iterator. 501 510 psMetadataItem *multiCheckItem = psMetadataLookup(in, inItem->name); 502 511 unsigned int flag = PS_META_REPLACE | PS_META_REQUIRE_ENTRY | PS_META_REQUIRE_TYPE; // Flag to indicate MULTI; otherwise, replace 512 503 513 if (multiCheckItem->type == PS_DATA_METADATA_MULTI) { 504 514 psTrace("psLib.types", 10, "MULTI: %s (%s)\n", inItem->name, inItem->comment); -
branches/eam_branch_20080408/psLib/src/types/psMetadataConfig.c
r15505 r17391 11 11 * @author Joshua Hoblitt, University of Hawaii 2006-2007 12 12 * 13 * @version $Revision: 1.142 $ $Name: not supported by cvs2svn $14 * @date $Date: 200 7-11-08 04:24:01$13 * @version $Revision: 1.142.4.1 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2008-04-08 18:26:00 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 802 802 } 803 803 804 // If type is not MULTI or META then get the value and comment 805 if((mdType != PS_DATA_METADATA_MULTI) && (mdType != PS_DATA_METADATA)) { 804 // If type is MULTI or META then check for the (optional) directives UPDATE or RESET; 805 // otherwise, get the value and comment. 806 if((mdType == PS_DATA_METADATA_MULTI) || (mdType == PS_DATA_METADATA)) { 807 // Get the metadata item value if there is one. 808 status = 0; 809 strValue = getToken (&linePtr, "#", &status, true); 810 811 if (status) { 812 psError(PS_ERR_IO, true, _("Failed to examine line for optional directive.")); 813 psFree(strType); 814 psFree(strValue); 815 return false; 816 } 817 818 if (strValue) { 819 // found a directive, what does it say? 820 if (strcasecmp (strValue, "UPDATE") && strcasecmp (strValue, "UPDATE")) { 821 psError(PS_ERR_IO, true, _("Invalid directive %s for METADATA or MULTI.", strValue)); 822 psFree(strType); 823 psFree(strValue); 824 return false; 825 } 826 827 // found a directive, what does it say? 828 if (!strcasecmp (strValue, "UPDATE")) { 829 // XXX set the flag DUPLICATE_OK (or whatver it is we need) 830 flags |= UPDATE; 831 } 832 if (!strcasecmp (strValue, "RESET")) { 833 // XXX set the flag REPLACE (or whatver it is we need) 834 flags |= RESET; 835 } 836 } 837 psFree(strValue); 838 strValue = NULL; 839 840 // Not all lines will have comments, so NULL is ok. 841 status = 0; 842 843 // XXX this is a very ugly way of finding from the current position to 844 // the end of the line 845 strComment = getToken(&linePtr, "", &status, true); 846 847 if (status) { 848 psError(PS_ERR_IO, true, _("Error reading a metadata comment")); 849 psFree(strType); 850 psFree(strComment); 851 return false; 852 } 853 } else { 806 854 // Get the metadata item value if there is one. 807 855 status = 0; … … 833 881 return false; 834 882 } 835 } 883 } 836 884 837 885 #define PARSE_ADD_CASE(NAME, TYPE, PARSEFUNC) \
Note:
See TracChangeset
for help on using the changeset viewer.
