Changeset 20818
- Timestamp:
- Nov 24, 2008, 10:43:03 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/dbCheckStack.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/dbCheckStack.c
r20583 r20818 23 23 } 24 24 25 // the value might be a special type of number: RA,DEC in sexigesimal or 26 // time in YYYY/MM/DD, etc 27 // status = ohana_str_to_time (stack[i].name, &seconds); 28 // keep as time_t 29 // status = ohana_dms_to_ddd (&ddd, stack[i].name); 30 // keep as either hours (RA) or deg (DEC). 31 32 // strings protected by double quotes should parse to be special types of numbers 33 // (photcodes, dates, ra / dec) 34 if (stack[i].name[0] == '"') { 35 if (stack[i].name[strlen(stack[i].name) - 1] != '"') { 36 gprint (GP_ERR, "syntax error for field %s\n", stack[i].name); 37 goto failure; 38 } 39 char *tmpstring; 40 tmpstring = strncreate (&stack[i].name[1], strlen(stack[i].name) - 2); 41 42 // attempt to parse the string as a special word: 43 PhotCode *code; 44 code = GetPhotcodebyName (tmpstring); 45 if (code) { 46 stack[i].Float = code->code; 47 stack[i].type = 'S'; 48 continue; 49 } 50 51 // add in tests for sexigesimal, date/time 52 // TimeRefPM = ohana_date_to_sec ("2000/01/01"); 53 54 gprint (GP_ERR, "syntax error for field %s\n", stack[i].name); 55 goto failure; 56 } 57 25 58 // this must be a field : is it already in the list? 26 59 for (j = 0; (j < Nfields) && strcasecmp (stack[i].name, fields[j].name); j++); … … 33 66 } 34 67 35 // the value might be a special type of number: RA,DEC in sexigesimal or36 // time in YYYY/MM/DD, etc37 // status = ohana_str_to_time (stack[i].name, &seconds);38 // keep as time_t39 // status = ohana_dms_to_ddd (&ddd, stack[i].name);40 // keep as either hours (RA) or deg (DEC).41 42 68 // this must be a field : is it a valid name? 43 69 if (table == DVO_TABLE_MEASURE) { … … 49 75 if (!status) { 50 76 gprint (GP_ERR, "unknown database field %s\n", stack[i].name); 51 return (FALSE);77 goto failure; 52 78 } 53 79 stack[i].field = Nfields; … … 63 89 *inNfields = Nfields; 64 90 *inFields = fields; 91 return (TRUE); 65 92 66 return (TRUE); 93 failure: 94 *inNfields = Nfields; 95 *inFields = fields; 96 return (FALSE); 67 97 } 68 98
Note:
See TracChangeset
for help on using the changeset viewer.
