Changeset 8768
- Timestamp:
- Sep 7, 2006, 11:47:31 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/types/psMetadataConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psMetadataConfig.c
r8767 r8768 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.7 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-09-07 21: 24:47$12 * @version $Revision: 1.78 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-09-07 21:47:31 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 295 295 psS32 *status) 296 296 { 297 psTime *out; 298 long sec = 0; 299 unsigned int nsec = 0; 300 char *end = NULL; 301 out = psTimeAlloc(tt); 302 303 sec = strtol(inString, &end, 10); 304 out->sec = sec; 305 while (!strncmp(end, " ", 1)) 306 end++; 307 inString = end; 308 nsec = (unsigned int)strtoul(inString, &end, 10); 309 out->nsec = nsec; 310 if (out->sec == 0 && out->nsec == 0) 311 *status = 1; 312 while (!strncmp(end, " ", 1)) 313 end++; 314 inString = end; 315 if ( !strncmp(inString, "false", 10) || !strncmp(inString, "f", 10) || 316 !strncmp(inString, "FALSE", 10) || !strncmp(inString, " F", 10) ) 317 out->leapsecond = false; 318 else if ( !strncmp(inString, "true", 10) || !strncmp(inString, "t", 10) || 319 !strncmp(inString, "TRUE", 10) || !strncmp(inString, "T", 10) ) 320 out->leapsecond = true; 321 else { 322 *status = 1; 323 } 297 PS_ASSERT_PTR_NON_NULL(status, NULL); 298 if (!inString) { 299 *status = 0; 300 return NULL; 301 } 302 303 psTime *out = psTimeFromISO(inString, tt); 304 305 if (!out) { 306 *status = 0; 307 return NULL; 308 } 309 310 *status = 1; 311 324 312 return out; 325 313 }
Note:
See TracChangeset
for help on using the changeset viewer.
