#ifndef _PARSEDATE_H_65e60e20_ #define _PARSEDATE_H_65e60e20_ /* This file is in the public domain. */ #include /* * Simple interface: parse a date/time and return its time_t. */ extern time_t parsedate(const char *); /* * Extended interface. * * The first argument and return value work basically as for * parsedate(). The second argument specifies extension bits; some of * these imply the presence of extra arguments, which appear after the * bits. If multiple bits indicate extra arguments, they appear in * the order in which the bits are listed here. */ extern time_t parsedate_ext(const char *, unsigned int, ...); /* * ALLOWFRAC indicates that fractional seconds may appear in the * string. (ALLOWFRAC by itself does not cause any fraction which may * be present to be stored anywhere.) * * No extra arguments. */ #define PARSEDATE_EXT_ALLOWFRAC 0x00000001 /* * STOREFRAC specifies where to store fractional seconds. (If * ALLOWFRAC is not specified, the fractional value is always zero.) * The value is stored as an int, and represents the fraction in * microseconds (ie, scaled by 1e6). If STOREFRAC is specified and an * error occurs, it is unspecified whether the argument is stored * through; the value stored, if a store happens, is also unspecified. * * One extra argument, of type "int *". */ #define PARSEDATE_EXT_STOREFRAC 0x00000002 /* * Convenience definition, since ALLOWFRAC and STOREFRAC are most * useful together. */ #define PARSEDATE_EXT_FRAC (PARSEDATE_EXT_ALLOWFRAC|PARSEDATE_EXT_STOREFRAC) #endif