opendir-safer.c: don't clobber errno; don't close negative FD
[pspp] / lib / parse-duration.h
index fbc732ff39c0e4110713c22970831353174c3b61..9fd2a364cdb1ac00ed4083f5465c926eb40e37b2 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse a time duration and return a seconds count
 /* Parse a time duration and return a seconds count
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 Free Software Foundation, Inc.
    Written by Bruce Korb <bkorb@gnu.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
    Written by Bruce Korb <bkorb@gnu.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
 
   ==== if it is a digit
 
 
   ==== if it is a digit
 
-  the string may contain:  NNN d NNN h NNN m NNN s
-  This represents NNN days, NNN hours, NNN minutes and NNN seconds.
+  the string may contain:  NNN Y NNN M NNN W NNN d NNN h NNN m NNN s
+  This represents NNN years, NNN months, NNN weeks, NNN days, NNN hours,
+    NNN minutes and NNN seconds.
   The embeded white space is optional.
   These terms must appear in this order.
   The embeded white space is optional.
   These terms must appear in this order.
+  Case is significant:  'M' is months and 'm' is minutes.
   The final "s" is optional.
   All of the terms ("NNN" plus designator) are optional.
   Minutes and seconds may optionally be represented as NNN:NNN.
   The final "s" is optional.
   All of the terms ("NNN" plus designator) are optional.
   Minutes and seconds may optionally be represented as NNN:NNN.
@@ -83,6 +85,6 @@
 /* Parses the given string.  If it has the syntax of a valid duration,
    this duration is returned.  Otherwise, the return value is BAD_TIME,
    and errno is set to either EINVAL (bad syntax) or ERANGE (out of range).  */
 /* Parses the given string.  If it has the syntax of a valid duration,
    this duration is returned.  Otherwise, the return value is BAD_TIME,
    and errno is set to either EINVAL (bad syntax) or ERANGE (out of range).  */
-extern time_t parse_duration(char const * in_pz);
+extern time_t parse_duration (char const * in_pz);
 
 #endif /* GNULIB_PARSE_DURATION_H */
 
 #endif /* GNULIB_PARSE_DURATION_H */