Re: parse_time()

2008-11-02 Thread Bruce Korb
Bruno Haible wrote: Looking at wikipedia [1], I would find it good if 1) the function was called 'parse_duration', not 'parse_time' (since "time" often denotes a time instant within a day), 2) the three duration formats described in [1] were also support

Re: parse_time()

2008-11-02 Thread Bruno Haible
> 3? I only see one, though with lots of optional fields. I meant the three: PnYnMnDTnHnMnS, PnW, and PT. > That format also doesn't allow for visual space. Yes, it's more meant for durations that are exchanged between software, not entered by humans. > The little question remaining though is

Re: parse_time()

2008-11-02 Thread Bruce Korb
ong should I wait" option. Though "timeout" only accepts it as an operand. > Looking at wikipedia [1], I would find it good if > 1) the function was called 'parse_duration', not 'parse_time' (since "time" > often denotes a time instant wit

Re: parse_time()

2008-11-02 Thread Bruno Haible
t good if 1) the function was called 'parse_duration', not 'parse_time' (since "time" often denotes a time instant within a day), 2) the three duration formats described in [1] were also supported. Bruno [1] http://en.wikipedia.org/wiki/ISO_8601#Durations

parse_time()

2008-11-01 Thread Bruce Korb
errno = EINVAL; return ~0; } return start; } time_t parse_time(char const * in_pz) { whats_done_t whatd_we_do = NOTHING_IS_DONE; char * pz; time_t val; time_t res = 0; while (isspace(*in_pz)) in_pz++; if (! isdigit((int)*in_pz)) goto bad_time; do { err