Clean up printing
This commit is contained in:
parent
5d73f2f004
commit
d08f81a6cf
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! \defgroup parser Parsing and validation routines.
|
/*! \defgroup parser Parsing, printing and validation routines.
|
||||||
|
|
||||||
These routines are used for parsing an ISO8601 date/time string into the internal structure used
|
These routines are used for parsing an ISO8601 date/time string into the internal structure used
|
||||||
to represent them, and for validating such dates/times.
|
to represent them, and for validating such dates/times.
|
||||||
|
@ -37,6 +37,22 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Print ISO8601 date/time into string.
|
||||||
|
|
||||||
|
\param str Pointer to buffer into which result is written.
|
||||||
|
\param amt Number of bytes in \a str.
|
||||||
|
\param date Date to print.
|
||||||
|
\param details Formatting details (may be 0).
|
||||||
|
|
||||||
|
Formats and prints an ISO8601 date, optionally using the details in \a details. Will always return
|
||||||
|
a null-terminated result, even if that means truncating the output to fit the buffer.
|
||||||
|
|
||||||
|
*/
|
||||||
|
void iso8601_print(char* str, int amt, const struct iso8601_date* date,
|
||||||
|
const struct iso8601_details* details);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Validate ISO8601 date/time.
|
/*! \brief Validate ISO8601 date/time.
|
||||||
|
|
||||||
\param date The date to validate.
|
\param date The date to validate.
|
||||||
|
|
|
@ -5,15 +5,6 @@
|
||||||
* http://www.gnu.org/copyleft/gpl.html for details.
|
* http://www.gnu.org/copyleft/gpl.html for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* c_library.c */
|
|
||||||
void iso8601_now(struct iso8601_date* date, struct iso8601_details* details);
|
|
||||||
void iso8601_from_ts(struct iso8601_date* date, const struct timespec* ts);
|
|
||||||
void iso8601_to_ts(struct timespec* ts, const struct iso8601_date* date);
|
|
||||||
void iso8601_from_time_t(struct iso8601_date* date, const time_t* t);
|
|
||||||
void iso8601_to_time_t(time_t* t, const struct iso8601_date* date);
|
|
||||||
|
|
||||||
/* calc.c */
|
/* calc.c */
|
||||||
int iso8601_isleap(int year);
|
int iso8601_isleap(int year);
|
||||||
void iso8601_to_cal(int* year, int* month, int* day, const struct iso8601_date* date);
|
void iso8601_to_cal(int* year, int* month, int* day, const struct iso8601_date* date);
|
||||||
|
@ -25,10 +16,6 @@ int iso8601_from_week(struct iso8601_date* date, int year, int week, int wday);
|
||||||
void iso8601_to_clocktime(int* hour, int* min, int* sec, const struct iso8601_date* date);
|
void iso8601_to_clocktime(int* hour, int* min, int* sec, const struct iso8601_date* date);
|
||||||
int iso8601_from_clocktime(struct iso8601_date* date, int hour, int min, int sec);
|
int iso8601_from_clocktime(struct iso8601_date* date, int hour, int min, int sec);
|
||||||
|
|
||||||
/* print.c */
|
|
||||||
void iso8601_print(char* str, int amt, const struct iso8601_date* date,
|
|
||||||
const struct iso8601_details* details);
|
|
||||||
|
|
||||||
/* manip.c */
|
/* manip.c */
|
||||||
int iso8601_lt(const struct iso8601_date* d1, const struct iso8601_date* d2);
|
int iso8601_lt(const struct iso8601_date* d1, const struct iso8601_date* d2);
|
||||||
int iso8601_lte(const struct iso8601_date* d1, const struct iso8601_date* d2);
|
int iso8601_lte(const struct iso8601_date* d1, const struct iso8601_date* d2);
|
||||||
|
|
Loading…
Reference in New Issue