From d09e55e8ae57b238372eed3bab516502deda7b43 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Mon, 6 Apr 2009 14:56:00 +0000 Subject: [PATCH 01/37] Update build system --- make.sh | 10 +++++----- run-test.sh | 10 +++++----- src/tests/build.tests | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/make.sh b/make.sh index 8a41493..7d11652 100755 --- a/make.sh +++ b/make.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash # libiso8601/make.sh # -# (c)2006-2007, Laurence Withers, . +# (c)2009, Laurence Withers, . # Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # @@ -15,19 +15,19 @@ then echo "Configuration file not found???" exit 1 fi -source "config" # don't fail on error, since last command in config might return false +source "./config" # don't fail on error, since last command in config might return false # Get version information -source version || exit 1 +source "./version" || exit 1 VERSION="${VERMAJOR}.${VERMINOR}.${VERMICRO}" # Get standard functions [ -z "${VERBOSE}" ] && VERBOSE="0" -source scripts/functions.sh || exit 1 +source "./scripts/functions.sh" || exit 1 # List of directories which will be emptied by clean. diff --git a/run-test.sh b/run-test.sh index f563592..cb337f2 100755 --- a/run-test.sh +++ b/run-test.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash # libiso8601/test.sh # -# (c)2007, Laurence Withers, . +# (c)2009, Laurence Withers, . # Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # @@ -33,10 +33,10 @@ print_tests() { echo "---------------------------------------------------------------------" for EXE in obj/tests/* do - [ -x ${EXE} ] || continue - NAME=$(echo ${EXE} | sed 's,obj/tests/,,') + [ -x "${EXE}" ] || continue + NAME="$(echo "${EXE}" | sed 's,obj/tests/,,')" echo -ne "${NAME}\t" - LD_LIBRARY_PATH="obj" ${EXE} --print-summary + LD_LIBRARY_PATH="obj" "${EXE}" --print-summary done } diff --git a/src/tests/build.tests b/src/tests/build.tests index a8ca886..2a31b3b 100644 --- a/src/tests/build.tests +++ b/src/tests/build.tests @@ -14,7 +14,7 @@ then for SRC in src/tests/*.c do - TEST="obj/tests/$(basename ${SRC} | sed -e 's,.c$,,')" + TEST="obj/tests/$(basename "${SRC}" ".c")" MODIFIED=0 for file in ${LIBS} ${SRC} src/tests/build.tests do From 1d9447dcd2b5324de68564c9c18b3b6f54cc6bc9 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Mon, 6 Apr 2009 14:58:05 +0000 Subject: [PATCH 02/37] Add iso8601_cmp(), comparison function for qsort() --- src/libiso8601/400_manip.c | 13 +++++++++++++ src/libiso8601/400_manip.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/libiso8601/400_manip.c b/src/libiso8601/400_manip.c index f766b18..c6ce9a8 100644 --- a/src/libiso8601/400_manip.c +++ b/src/libiso8601/400_manip.c @@ -38,6 +38,19 @@ int iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2) +int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2) +{ + if(d1->day < d2->day) return -1; + if(d1->day > d2->day) return 1; + if(d1->sec < d2->sec) return -1; + if(d1->sec > d2->sec) return 1; + if(d1->nsec < d2->nsec) return -1; + if(d1->nsec > d2->nsec) return 1; + return 0; +} + + + void iso8601_add_elapsed(struct iso8601_date* date, const struct iso8601_elapsed* per) { div_t qr; diff --git a/src/libiso8601/400_manip.h b/src/libiso8601/400_manip.h index c8d69dc..dd80360 100644 --- a/src/libiso8601/400_manip.h +++ b/src/libiso8601/400_manip.h @@ -53,6 +53,19 @@ int iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2); +/*! \brief Comparison (for qsort et al.). + +\param d1 First date to compare. +\param d2 Second date to compare. +\retval -1 if \a d1 < \a d2 +\retval 0 if \a d1 == \a d2 +\retval 1 if \a d1 > \a d2 + +*/ +int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2); + + + /*! \brief Add a period to a date. \param[in,out] date Date to modify. From 47ccc537b8d135dbe2c39b4f784b092ff5d9caf5 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Mon, 6 Apr 2009 14:58:26 +0000 Subject: [PATCH 03/37] Bump version --- src/libiso8601/soversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion index 3d77ea3..5c622af 100644 --- a/src/libiso8601/soversion +++ b/src/libiso8601/soversion @@ -12,4 +12,4 @@ SOMAJOR=1 # SOMICRO is bumped every time there is a binary-compatible release. -SOMICRO=3 +SOMICRO=4 From dcfc699af00a800976d6de90b632f789ab2fad79 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Mon, 6 Apr 2009 14:58:26 +0000 Subject: [PATCH 04/37] Bump version --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 7639570..a57ed21 100644 --- a/version +++ b/version @@ -11,7 +11,7 @@ # expected to be in 'major.minor.micro' format. VERMAJOR=0 VERMINOR=3 -VERMICRO=5 +VERMICRO=6 # kate: replace-trailing-space-save true; space-indent true; tab-width 4; # vim: expandtab:ts=4:sw=4:syntax=sh From b7d039a32c7904739f56b5fec2103f612028ca88 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Fri, 29 May 2009 14:51:14 +0000 Subject: [PATCH 05/37] Add iso8601_elapsed_divide() --- src/libiso8601/400_manip.c | 25 +++++++++++++++++++++++++ src/libiso8601/400_manip.h | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/libiso8601/400_manip.c b/src/libiso8601/400_manip.c index c6ce9a8..40a0dd8 100644 --- a/src/libiso8601/400_manip.c +++ b/src/libiso8601/400_manip.c @@ -160,6 +160,31 @@ void iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date +int iso8601_elapsed_div(const struct iso8601_elapsed* num, const struct iso8601_elapsed* denom, + struct iso8601_elapsed* remain) +{ + unsigned long long pnum, pdenom; + lldiv_t val, v2; + + pnum = num->sec; + pnum *= BILLION; + pnum += num->nsec; + + pdenom = denom->sec; + pdenom *= BILLION; + pdenom += denom->nsec; + + val = lldiv(pnum, pdenom); + if(remain) { + v2 = lldiv(val.rem, BILLION); + remain->sec = v2.quot; + remain->nsec = v2.rem; + } + return val.quot; +} + + + /* options for text editors kate: replace-trailing-space-save true; space-indent true; tab-width 4; vim: expandtab:ts=4:sw=4 diff --git a/src/libiso8601/400_manip.h b/src/libiso8601/400_manip.h index dd80360..b7faf39 100644 --- a/src/libiso8601/400_manip.h +++ b/src/libiso8601/400_manip.h @@ -117,6 +117,27 @@ void iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date +/*! \brief Divide one period by another. + +\param num Numerator. +\param denom Denominator (divisor). +\param[out] remain Remainder. May be 0. +\returns Number of times \a denom divides into \a num. + +This function computes the number of times that \a denom can be divided into \a num, returning that +number. If desired, the remaining period which could not be divided can be written into \a remain. +Uses 64-bit arithmetic internally. + +*/ +int iso8601_elapsed_div(const struct iso8601_elapsed* num, const struct iso8601_elapsed* denom, + struct iso8601_elapsed* remain) +#ifndef DOXYGEN + __attribute__((nonnull(1,2))); +#endif +; + + + /*!@}*/ /* options for text editors kate: replace-trailing-space-save true; space-indent true; tab-width 4; From 7ba82a29882b6382e449cecc0009e58de0b042e8 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Fri, 29 May 2009 14:51:26 +0000 Subject: [PATCH 06/37] Add default path for iso8601_leap_table_load() --- config | 2 ++ src/libiso8601/100_leap.c | 2 ++ src/libiso8601/400_leap.h | 6 ++++-- src/libiso8601/build.lib | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config b/config index 8c6771c..8382c24 100644 --- a/config +++ b/config @@ -32,5 +32,7 @@ source "scripts/paths" # Project-specific variables below. +[ -z "${DEFAULT_LEAP_TABLE}" ] && DEFAULT_LEAP_TABLE="${SHAREDIR}/libiso8601/leap-table" + [ -z "${CC}" ] && CC="gcc" [ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall" diff --git a/src/libiso8601/100_leap.c b/src/libiso8601/100_leap.c index 20647de..cdba1a7 100644 --- a/src/libiso8601/100_leap.c +++ b/src/libiso8601/100_leap.c @@ -96,6 +96,8 @@ int iso8601_leap_table_load(const char* fname) int fd, saved_errno, i, new_size, * days = 0; char buf[12]; + if(!fname) fname = DEFAULT_LEAP_TABLE; + if(stat(fname, &st)) return -1; if(st.st_size < 12) { errno = EINVAL; diff --git a/src/libiso8601/400_leap.h b/src/libiso8601/400_leap.h index 05304ca..e090b80 100644 --- a/src/libiso8601/400_leap.h +++ b/src/libiso8601/400_leap.h @@ -91,17 +91,19 @@ void iso8601_leap_table_set(int* new_table, int new_size) __attribute__((nonnull /*! \brief Load new table of leap seconds from disk. -\param fname Filename. +\param fname Filename. May be 0 for system default. \retval 0 on success. \retval -1 on error (and see \a errno). This function attempts to load a new table of leap seconds from disk, using the filename \a fname. +If \a fname is not specified, the system default (set at compile time) will be used. + If the table is loaded successfully, it will be set with \ref iso8601_leap_table_set(). On any error, -1 will be returned, and \a errno will be set appropriately. If \a errno is \c EINVAL, then the file does not contain a valid leap second table. */ -int iso8601_leap_table_load(const char* fname) __attribute__((nonnull)); +int iso8601_leap_table_load(const char* fname); diff --git a/src/libiso8601/build.lib b/src/libiso8601/build.lib index 080592f..3937758 100644 --- a/src/libiso8601/build.lib +++ b/src/libiso8601/build.lib @@ -14,7 +14,7 @@ then libiso8601="obj/${libiso8601_BASE}.so.${SOMAJOR}.${SOMICRO}" libiso8601_DEP_CFLAGS="" libiso8601_DEP_LIBS="-lrt" - SO_EXTRA="-std=gnu99 -D_GNU_SOURCE ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} -lc" + SO_EXTRA="-std=gnu99 -D_GNU_SOURCE -DDEFAULT_LEAP_TABLE=\"${DEFAULT_LEAP_TABLE}\" ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} -lc" echo "Building library ${libiso8601}..." From 1a0553e08342554c2382e4f76ad0901457c27721 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Fri, 29 May 2009 14:52:52 +0000 Subject: [PATCH 07/37] Bump version --- src/libiso8601/soversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion index 5c622af..a37b99a 100644 --- a/src/libiso8601/soversion +++ b/src/libiso8601/soversion @@ -12,4 +12,4 @@ SOMAJOR=1 # SOMICRO is bumped every time there is a binary-compatible release. -SOMICRO=4 +SOMICRO=5 From e504a722f51ac7c7c7d64fc1c1a52287eb7a3c25 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Fri, 29 May 2009 14:52:52 +0000 Subject: [PATCH 08/37] Bump version --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index a57ed21..bb1611e 100644 --- a/version +++ b/version @@ -11,7 +11,7 @@ # expected to be in 'major.minor.micro' format. VERMAJOR=0 VERMINOR=3 -VERMICRO=6 +VERMICRO=7 # kate: replace-trailing-space-save true; space-indent true; tab-width 4; # vim: expandtab:ts=4:sw=4:syntax=sh From 6285d214aab6c678248f57f3f61fc3c3420b8fdb Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Fri, 8 Jan 2010 18:46:34 +0000 Subject: [PATCH 09/37] Documentation and annotation updates This commit updates the Doxygen documentation (particularly taking into account a request from Kelly Dunlop for more verbose notice about which members are changed by iso8601_from_*()) and file/function annotation/formatting to current standards. --- src/libiso8601/100_types.h | 46 ++++++++------- src/libiso8601/200_parser.h | 62 ++++++++++++-------- src/libiso8601/400_c_library.h | 66 ++++++++++++++++------ src/libiso8601/400_calc.h | 100 +++++++++++++++++++++++++-------- src/libiso8601/400_leap.h | 99 ++++++++++++++++++++------------ src/libiso8601/400_manip.h | 83 +++++++++++++++++++-------- 6 files changed, 315 insertions(+), 141 deletions(-) diff --git a/src/libiso8601/100_types.h b/src/libiso8601/100_types.h index 77b0a01..fa92a77 100644 --- a/src/libiso8601/100_types.h +++ b/src/libiso8601/100_types.h @@ -1,7 +1,7 @@ /* libiso8601/src/libiso8601/100_types.h * - * (c)2006, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * (c)2006-2010, Laurence Withers, . + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -9,19 +9,20 @@ /*! \brief Date/time point. -This structure contains the details to represent a specific instant on the UTC timescale. It uses -Jan 1, year 0000 as the origin (when \a day will be 0). \a sec is the number of seconds elapsed -since start of day, and \a nsec is the number of nanoseconds elapsed since the start of the current -second. +This structure contains the details to represent a specific instant on the UTC +timescale. It uses Jan 1, year 0000 as the origin (when \a day will be 0). \a +sec is the number of seconds elapsed since start of day, and \a nsec is the +number of nanoseconds elapsed since the start of the current second. -We correctly deal with leap seconds by encoding 23:59:60 as having a \a sec field of 86400. +We correctly deal with leap seconds by encoding 23:59:60 as having a \a sec +field of 86400. */ struct iso8601_date { /*! \brief Number of nanoseconds elapsed since start of second. */ int32_t nsec; - /*! \brief Number of days elapsed since Jan 1, year 0000. May be negative. */ + /*! \brief Number of days elapsed since Jan 1, year 0000. May be negative.*/ int32_t day; /*! \brief Number of seconds elapsed since start of day. */ @@ -33,9 +34,10 @@ struct iso8601_date { /*! \brief Date (day portion) precision. \ingroup parser -This enumeration will record how precisely the date was specified, as well as the format in use. It -allows the library to determine the earliest and latest dates that could possibly be represented -with the given input and also allows the output format to match the input format. +This enumeration will record how precisely the date was specified, as well as +the format in use. It allows the library to determine the earliest and latest +dates that could possibly be represented with the given input and also allows +the output format to match the input format. */ enum iso8601_date_prec { @@ -63,9 +65,10 @@ enum iso8601_date_prec { /*! \brief Time precision. \ingroup parser -This enumeration records how precisely the time was specified as well as its format. The fractional -format will record whether it was the hour, minute or second that was specified with a fractional -part, allowing a processed date/time to be presented to the user in the format it was originally +This enumeration records how precisely the time was specified as well as its +format. The fractional format will record whether it was the hour, minute or +second that was specified with a fractional part, allowing a processed +date/time to be presented to the user in the format it was originally encountered. */ @@ -90,10 +93,10 @@ enum iso8601_time_prec { /*! \brief Date/time formatting details. -This structure simply records details related to the formatting (and precision) of a date/time -structure. The structure can be filled out by the parser so that a program's output can match -the format of its input. Alternatively it can be controlled by the program to provide a consistent -output format. +This structure simply records details related to the formatting (and precision) +of a date/time structure. The structure can be filled out by the parser so that +a program's output can match the format of its input. Alternatively it can be +controlled by the program to provide a consistent output format. */ struct iso8601_details { @@ -114,9 +117,10 @@ struct iso8601_details { /*! \brief Short period elapsed time. -This structure contains the details of an elapsed time period, split into seconds and nanoseconds. -None of its components can ever be negative. This is only capable of representing short (compared to -struct iso8601_date's range) periods of up to approximately 136 years. +This structure contains the details of an elapsed time period, split into +seconds and nanoseconds. None of its components can ever be negative. This is +only capable of representing short (compared to struct iso8601_date's range) +periods of up to approximately 136 years. */ struct iso8601_elapsed { diff --git a/src/libiso8601/200_parser.h b/src/libiso8601/200_parser.h index 3aa4e85..ed31849 100644 --- a/src/libiso8601/200_parser.h +++ b/src/libiso8601/200_parser.h @@ -1,7 +1,7 @@ /* libiso8601/src/libiso8601/200_parser.h * - * (c)2006, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * (c)2006-2010, Laurence Withers, . + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -9,31 +9,41 @@ /*! \defgroup parser Parsing, printing and validation routines. -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. +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. */ /*!@{*/ + + /*! \brief Parse ISO8601 date/time. \param str The input string. Whitespace will be stripped. -\param[out] earliest The earliest possible time the string could represent. May be 0. -\param[out] latest The latest possible time the string could represent. May be 0. -\param[out] details Stores details such as the precision to which the time/date were specified. May +\param[out] earliest The earliest possible time the string could represent. May be 0. +\param[out] latest The latest possible time the string could represent. May be + 0. +\param[out] details Stores details such as the precision to which the time/date + were specified. May be 0. \retval -1 on error. \retval 0 on success. -Parses a string containing the ISO8601 date/time. Deals with any format of date, optionally storing -the details in \a details. The time may be partial, in which case this function returns the earliest -and latest times that could possibly be represented by the string. +Parses a string containing the ISO8601 date/time. Deals with any format of +date, optionally storing the details in \a details. The time may be partial, in +which case this function returns the earliest and latest times that could +possibly be represented by the string. -Note that this function will accept leap seconds (23:59:60) on days on which they occurred. +Note that this function will accept leap seconds (23:59:60) on days on which +they occurred. */ -int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601_date* latest, - struct iso8601_details* details); +int iso8601_parse(const char* str, struct iso8601_date* earliest, + struct iso8601_date* latest, struct iso8601_details* details) +#ifndef DOXYGEN + __attribute__((nonnull(1),warn_unused_result)) +#endif +; @@ -45,12 +55,17 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601 \param details Formatting details (may be 0). \returns Pointer to buffer (\a str). -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. +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. */ char* iso8601_print(char* str, int amt, const struct iso8601_date* date, - const struct iso8601_details* details); + const struct iso8601_details* details) +#ifndef DOXYGEN + __attribute__((nonnull(1,3))) +#endif +; @@ -60,18 +75,21 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date, \retval -1 if not valid. \retval 0 if valid. -Checks the details of \a date to ensure that they are sensible. This involves checking that \a sec -is in the range 0 to 86399 (or 86400 if there is a leap second), and that \a nsec is in the range 0 -to 999999999. +Checks the details of \a date to ensure that they are sensible. This involves +checking that \a sec is in the range 0 to 86399 (or 86400 if there is a leap +second), and that \a nsec is in the range 0 to 999999999. */ -int iso8601_invalid(const struct iso8601_date* date); +int iso8601_invalid(const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; /*!@}*/ - /* options for text editors kate: replace-trailing-space-save true; space-indent true; tab-width 4; -vim: expandtab:ts=4:sw=4 +vim: expandtab:ts=4:sw=4:syntax=ch.doxygen */ diff --git a/src/libiso8601/400_c_library.h b/src/libiso8601/400_c_library.h index c5e6b59..1a75cd0 100644 --- a/src/libiso8601/400_c_library.h +++ b/src/libiso8601/400_c_library.h @@ -1,7 +1,7 @@ /* libiso8601/src/libiso8601/400_c_library.h * - * (c)2006, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * (c)2006-2010, Laurence Withers, . + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -9,7 +9,8 @@ /*! \defgroup c_library C library integration. -These functions enable integration with the C library (system call wrappers and conversion). +These functions enable integration with the C library (system call wrappers and +conversion). */ /*!@{*/ @@ -21,8 +22,8 @@ These functions enable integration with the C library (system call wrappers and \param[out] date Current date/time (may be 0), in UTC. \param[out] details Details (may be 0), including timezone. -Retrieves the current time from the system clock, storing it into \a date and \a details (both -parameters optional). +Retrieves the current time from the system clock, storing it into \a date and +\a details (both parameters optional). */ void iso8601_now(struct iso8601_date* date, struct iso8601_details* details); @@ -35,32 +36,65 @@ void iso8601_now(struct iso8601_date* date, struct iso8601_details* details); \retval 0 on success. \retval -1 on error (and see \a errno). -Attempts to set the system clock using \c clock_settime(), falling back to \c settimeofday(). The -user will need the \c CAP_SYS_TIME capability to set the clock, otherwise \a errno will be set to -\c EPERM. +Attempts to set the system clock using \c clock_settime(), falling back to \c +settimeofday(). The user will need the \c CAP_SYS_TIME capability to set the +clock, otherwise \a errno will be set to \c EPERM. */ -int iso8601_set_sysclock(const struct iso8601_date* date); +int iso8601_set_sysclock(const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; /*! \brief Convert from a struct timespec. */ -void iso8601_from_ts(struct iso8601_date* date, const struct timespec* ts); +void iso8601_from_ts(struct iso8601_date* date, const struct timespec* ts) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; + /*! \brief Convert to a struct timespec. */ -void iso8601_to_ts(struct timespec* ts, const struct iso8601_date* date); +void iso8601_to_ts(struct timespec* ts, const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; + /*! \brief Convert from a struct timeval. */ -void iso8601_from_tv(struct iso8601_date* date, const struct timeval* tv); +void iso8601_from_tv(struct iso8601_date* date, const struct timeval* tv) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; + /*! \brief Convert to a struct timeval. */ -void iso8601_to_tv(struct timeval* tv, const struct iso8601_date* date); +void iso8601_to_tv(struct timeval* tv, const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; + /*! \brief Convert from a time_t. */ -void iso8601_from_time_t(struct iso8601_date* date, const time_t* t); +void iso8601_from_time_t(struct iso8601_date* date, const time_t* t) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; + /*! \brief Convert to a time_t. */ -void iso8601_to_time_t(time_t* t, const struct iso8601_date* date); +void iso8601_to_time_t(time_t* t, const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; /*!@}*/ /* options for text editors kate: replace-trailing-space-save true; space-indent true; tab-width 4; -vim: expandtab:ts=4:sw=4 +vim: expandtab:ts=4:sw=4:syntax=ch.doxygen */ diff --git a/src/libiso8601/400_calc.h b/src/libiso8601/400_calc.h index 0145a35..9570d8d 100644 --- a/src/libiso8601/400_calc.h +++ b/src/libiso8601/400_calc.h @@ -1,7 +1,7 @@ /* libiso8601/src/libiso8601/400_calc.h * - * (c)2006, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * (c)2006-2010, Laurence Withers, . + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -9,8 +9,8 @@ /*! \defgroup calc Conversion and calculation routines. -This set of functions is useful for converting dates and times into formats understood by humans, -and vice versa. +This set of functions is useful for converting dates and times into formats +understood by humans, and vice versa. */ /*!@{*/ @@ -26,7 +26,11 @@ and vice versa. Returns non-0 if \a year is a leap year. */ -int iso8601_isleap(int year); +int iso8601_isleap(int year) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -38,7 +42,12 @@ int iso8601_isleap(int year); \param date Date to convert. */ -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) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -51,11 +60,18 @@ void iso8601_to_cal(int* year, int* month, int* day, const struct iso8601_date* \retval 0 on success. \retval -1 on error (and see \a errno). -Converts the date specified in \a year, \a month and \a day into \a date. Does not touch the \a sec -or \a nsec time members of \a date. +Converts the date specified in \a year, \a month and \a day into \a date. + +\note Does not touch the \a sec or \a nsec time members of \a date. This means + they will be unchanged after a call to this function. If this will lead to + unexpected results, initialise the structure to 0 first. */ -int iso8601_from_cal(struct iso8601_date* date, int year, int month, int day); +int iso8601_from_cal(struct iso8601_date* date, int year, int month, int day) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -66,7 +82,11 @@ int iso8601_from_cal(struct iso8601_date* date, int year, int month, int day); \param date Date to convert. */ -void iso8601_to_ord(int* year, int* oday, const struct iso8601_date* date); +void iso8601_to_ord(int* year, int* oday, const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -78,11 +98,18 @@ void iso8601_to_ord(int* year, int* oday, const struct iso8601_date* date); \retval 0 on success. \retval -1 on error (and see \a errno). -Converts the date specified into \a year and \a oday into \a date. Does not touch the \a sec or -\a nsec time members of \a date. +Converts the date specified into \a year and \a oday into \a date. + +\note Does not touch the \a sec or \a nsec time members of \a date. This means + they will be unchanged after a call to this functoin. If this will lead to + unexpected results, initialise the structure to 0 first. */ -int iso8601_from_ord(struct iso8601_date* date, int year, int oday); +int iso8601_from_ord(struct iso8601_date* date, int year, int oday) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -94,7 +121,12 @@ int iso8601_from_ord(struct iso8601_date* date, int year, int oday); \param date Date to convert. */ -void iso8601_to_week(int* year, int* week, int* wday, const struct iso8601_date* date); +void iso8601_to_week(int* year, int* week, int* wday, + const struct iso8601_date* date) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -107,8 +139,18 @@ void iso8601_to_week(int* year, int* week, int* wday, const struct iso8601_date* \retval 0 on success. \retval -1 on error (and see \a errno). +Converts the date specified into \a year, \a week and \a wday into \a date. + +\note Does not touch the \a sec or \a nsec time members of \a date. This means + they will be unchanged after a call to this functoin. If this will lead to + unexpected results, initialise the structure to 0 first. + */ -int iso8601_from_week(struct iso8601_date* date, int year, int week, int wday); +int iso8601_from_week(struct iso8601_date* date, int year, int week, int wday) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -119,11 +161,16 @@ int iso8601_from_week(struct iso8601_date* date, int year, int week, int wday); \param[out] sec Output second. \param date Date/time to convert. -Converts the time stored in \a date into wall clock format, storing the result in \a hour, \a min -and \a sec. +Converts the time stored in \a date into wall clock format, storing the result +in \a hour, \a min and \a sec. */ -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) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; @@ -136,16 +183,25 @@ void iso8601_to_clocktime(int* hour, int* min, int* sec, const struct iso8601_da \retval 0 on success. \retval -1 on error (and see \a errno). -Converts the time as specified by \a hour, \a min and \a sec, storing the result in \a date. Does -not touch the \a day (date) member of \a date. +Converts the time as specified by \a hour, \a min and \a sec, storing the +result in \a date. + +\note Does not touch the \a day (date) member of \a date. This means it will be + unchanged after a call to this function. If this will lead to unexpected + results, initialise the structure to 0 first. */ -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) +#ifndef DOXYGEN + __attribute__((nonnull)) +#endif +; /*!@}*/ /* options for text editors kate: replace-trailing-space-save true; space-indent true; tab-width 4; -vim: expandtab:ts=4:sw=4 +vim: expandtab:ts=4:sw=4:syntax=ch.doxygen */ diff --git a/src/libiso8601/400_leap.h b/src/libiso8601/400_leap.h index e090b80..2797464 100644 --- a/src/libiso8601/400_leap.h +++ b/src/libiso8601/400_leap.h @@ -1,7 +1,7 @@ /* libiso8601/src/libiso8601/400_leap.h * - * (c)2006, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * (c)2006-2010, Laurence Withers, . + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -9,20 +9,23 @@ /*! \defgroup leap Leap second support. -A set of functions for explicitly dealing with leap seconds. All library functions are implicitly -leap second aware, but there are occasions when leap seconds must be dealt with explicitly. These -functions permit this. +A set of functions for explicitly dealing with leap seconds. All library +functions are implicitly leap second aware, but there are occasions when leap +seconds must be dealt with explicitly. These functions permit this. -Internally, leap seconds are represented as a table of day numbers; each day number present in the -table means that the corresponding day has 86401 seconds (a leap second). +Internally, leap seconds are represented as a table of day numbers; each day +number present in the table means that the corresponding day has 86401 seconds +(a leap second). -\note The library does not (yet) have support for negative leap seconds. This support will be added - should a day with a negative leap second ever come. This will need to addressed in the API as - the current API does not support loading a table of negative leap seconds. +\note The library does not (yet) have support for negative leap seconds. This + support will be added should a day with a negative leap second ever come. + This will need to addressed in the API as the current API does not support + loading a table of negative leap seconds. -It is possible to create a disk file containing an updated table and to load that file using -\ref iso8601_leap_table_load (or to explicitly use an existing in-memory table with -\ref iso8601_leap_table_set). The format of the on-disk file is: +It is possible to create a disk file containing an updated table and to load +that file using \ref iso8601_leap_table_load (or to explicitly use an existing +in-memory table with \ref iso8601_leap_table_set). The format of the on-disk +file is:
# integers are stored big-endian
 [8*char] signature, "/O9PdPZI"
@@ -43,14 +46,19 @@ It is possible to create a disk file containing an updated table and to load tha
 \retval 86400 day with no leap second.
 \retval 86401 day with one leap second.
 
-Returns the duration of a day \a date, in seconds. This function takes leap seconds into account and
-may be used to determine if a day contains a leap second or not.
+Returns the duration of a day \a date, in seconds. This function takes leap
+seconds into account and may be used to determine if a day contains a leap
+second or not.
 
-\note There have not yet been any days requiring a negative leap second, so at present 86399 will
-    never be returned.
+\note There have not yet been any days requiring a negative leap second, so at
+    present 86399 will never be returned.
 
 */
-int iso8601_seconds_leap(const struct iso8601_date* date);
+int iso8601_seconds_leap(const struct iso8601_date* date)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -60,13 +68,19 @@ int iso8601_seconds_leap(const struct iso8601_date* date);
 \param end The end date.
 \returns Number of leap seconds elapsed.
 
-Computes the number of leap seconds that have elapsed between two days. Note that this is the sum of
-such leap seconds, so it will be 0 if (for example) there is one positive leap second and one 
-negative leap second. The ordering of the dates is important; if \a start is after \a end, then the
-value returned will be negative (for positive leap seconds).
+Computes the number of leap seconds that have elapsed between two days. Note
+that this is the sum of such leap seconds, so it will be 0 if (for example)
+there is one positive leap second and one negative leap second. The ordering of
+the dates is important; if \a start is after \a end, then the value returned
+will be negative (for positive leap seconds).
 
 */
-int iso8601_leap_elapsed(const struct iso8601_date* start, const struct iso8601_date* end);
+int iso8601_leap_elapsed(const struct iso8601_date* start,
+    const struct iso8601_date* end)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -75,17 +89,22 @@ int iso8601_leap_elapsed(const struct iso8601_date* start, const struct iso8601_
 \param new_table Array of day numbers on which leap seconds occur.
 \param new_size Number of entries in array.
 
-This function can be used to update the table of leap seconds at runtime. The \a new_table argument
-points to an array of integers, each entry being the day number containing a leap second.  The array
-must be sorted so that lower day numbers appear towards the start of the array. \a new_size gives
-the number of entries in the array. \a new_table must persist in memory as long as library functions
-are in use.
+This function can be used to update the table of leap seconds at runtime. The
+\a new_table argument points to an array of integers, each entry being the day
+number containing a leap second.  The array must be sorted so that lower day
+numbers appear towards the start of the array. \a new_size gives the number of
+entries in the array. \a new_table must persist in memory as long as library
+functions are in use.
 
-\warning If negative leap seconds are ever used, this function will not support them. There may need
-    to be an ABI change in future to solve this problem.
+\warning If negative leap seconds are ever used, this function will not support
+    them. There may need to be an ABI change in future to solve this problem.
 
 */
-void iso8601_leap_table_set(int* new_table, int new_size) __attribute__((nonnull));
+void iso8601_leap_table_set(int* new_table, int new_size)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -95,15 +114,21 @@ void iso8601_leap_table_set(int* new_table, int new_size) __attribute__((nonnull
 \retval 0 on success.
 \retval -1 on error (and see \a errno).
 
-This function attempts to load a new table of leap seconds from disk, using the filename \a fname.
-If \a fname is not specified, the system default (set at compile time) will be used.
+This function attempts to load a new table of leap seconds from disk, using the
+filename \a fname.  If \a fname is not specified, the system default (set at
+compile time) will be used.
 
-If the table is loaded successfully, it will be set with \ref iso8601_leap_table_set(). On any
-error, -1 will be returned, and \a errno will be set appropriately. If \a errno is \c EINVAL, then
-the file does not contain a valid leap second table.
+If the table is loaded successfully, it will be set with \ref
+iso8601_leap_table_set(). On any error, -1 will be returned, and \a errno will
+be set appropriately. If \a errno is \c EINVAL, then the file does not contain
+a valid leap second table.
 
 */
-int iso8601_leap_table_load(const char* fname);
+int iso8601_leap_table_load(const char* fname)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
diff --git a/src/libiso8601/400_manip.h b/src/libiso8601/400_manip.h
index b7faf39..2f45e2e 100644
--- a/src/libiso8601/400_manip.h
+++ b/src/libiso8601/400_manip.h
@@ -1,7 +1,7 @@
 /* libiso8601/src/libiso8601/400_manip.h
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
@@ -9,8 +9,8 @@
 
 /*! \defgroup manip Manipulation routines.
 
-This set of functions is useful for performing arithmetic etc. on dates. It uses 
-struct iso8601_elapsed to represent the magnitude of time differences.
+This set of functions is useful for performing arithmetic etc. on dates. It
+uses struct \ref iso8601_elapsed to represent the magnitude of time differences.
 
 */
 /*!@{*/
@@ -25,7 +25,11 @@ struct iso8601_elapsed to represent the magnitude of time differences.
 \retval 0 otherwise
 
 */
-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)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -37,7 +41,11 @@ int iso8601_lt(const struct iso8601_date* d1, const struct iso8601_date* d2);
 \retval 0 otherwise
 
 */
-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)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -49,7 +57,11 @@ int iso8601_lte(const struct iso8601_date* d1, const struct iso8601_date* d2);
 \retval 0 otherwise
 
 */
-int iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2);
+int iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -62,7 +74,11 @@ int iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2);
 \retval 1 if \a d1 > \a d2
 
 */
-int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2);
+int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -72,7 +88,12 @@ int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2);
 \param per Period to advance date/time by.
 
 */
-void iso8601_add_elapsed(struct iso8601_date* date, const struct iso8601_elapsed* per);
+void iso8601_add_elapsed(struct iso8601_date* date,
+    const struct iso8601_elapsed* per)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -82,7 +103,12 @@ void iso8601_add_elapsed(struct iso8601_date* date, const struct iso8601_elapsed
 \param per Period to regress date/time by.
 
 */
-void iso8601_subtract_elapsed(struct iso8601_date* date, const struct iso8601_elapsed* per);
+void iso8601_subtract_elapsed(struct iso8601_date* date,
+    const struct iso8601_elapsed* per)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -92,11 +118,17 @@ void iso8601_subtract_elapsed(struct iso8601_date* date, const struct iso8601_el
 \param per Period to advance date/time by.
 \param n Multiple of \a per.
 
-Adds \a n multiples of \a per to \a date. \a n may be 0 or negative. The result is stored in
-\a date. This is an efficient implementation which avoids loops, but it does use 64-bit arithmetic.
+Adds \a n multiples of \a per to \a date. \a n may be 0 or negative. The result
+is stored in \a date. This is an efficient implementation which avoids loops,
+but it does use 64-bit arithmetic.
 
 */
-void iso8601_add_multiple(struct iso8601_date* date, const struct iso8601_elapsed* per, int n);
+void iso8601_add_multiple(struct iso8601_date* date,
+    const struct iso8601_elapsed* per, int n)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -107,13 +139,18 @@ void iso8601_add_multiple(struct iso8601_date* date, const struct iso8601_elapse
 \param[out] per Magnitude of period elapsed between two dates. Pointer may be 0.
 \param[out] sign Set to sign of difference (-1 or +1). Pointer may be 0.
 
-This function will perform the calculation |d1 - d2|, storing the result in \a per (if
-it is not a null pointer). The sign of the result is stored in \a sign (if it is not a null 
-pointer), i.e. -1 if \a d2 > \a d1 or +1 if \a d2 <= \a d1.
+This function will perform the calculation |d1 - d2|, storing the
+result in \a per (if it is not a null pointer). The sign of the result is
+stored in \a sign (if it is not a null pointer), i.e. -1 if \a d2 > \a d1 or
++1 if \a d2 <= \a d1.
 
 */
-void iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date* d2,
-    struct iso8601_elapsed* per, int* sign);
+void iso8601_difference(const struct iso8601_date* d1,
+    const struct iso8601_date* d2, struct iso8601_elapsed* per, int* sign)
+#ifndef DOXYGEN
+    __attribute__((nonnull))
+#endif
+;
 
 
 
@@ -124,13 +161,13 @@ void iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date
 \param[out] remain Remainder. May be 0.
 \returns Number of times \a denom divides into \a num.
 
-This function computes the number of times that \a denom can be divided into \a num, returning that
-number. If desired, the remaining period which could not be divided can be written into \a remain.
-Uses 64-bit arithmetic internally.
+This function computes the number of times that \a denom can be divided into \a
+num, returning that number. If desired, the remaining period which could not be
+divided can be written into \a remain.  Uses 64-bit arithmetic internally.
 
 */
-int iso8601_elapsed_div(const struct iso8601_elapsed* num, const struct iso8601_elapsed* denom,
-    struct iso8601_elapsed* remain)
+int iso8601_elapsed_div(const struct iso8601_elapsed* num,
+    const struct iso8601_elapsed* denom, struct iso8601_elapsed* remain)
 #ifndef DOXYGEN
     __attribute__((nonnull(1,2)));
 #endif

From 9f3fbd4116fff5773495a794d36507457a96cfa3 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 8 Jan 2010 18:49:50 +0000
Subject: [PATCH 10/37] Minor build system update

A fix for when there are multiple libraries in a single package. Doesn't apply
here but just in case.
---
 src/libiso8601/build.install-lib | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libiso8601/build.install-lib b/src/libiso8601/build.install-lib
index 94d4460..3768c51 100644
--- a/src/libiso8601/build.install-lib
+++ b/src/libiso8601/build.install-lib
@@ -7,6 +7,7 @@ build_dir_tree "${INCLUDEDIR}" || return 1
 
 # install library
 echo "Installing libraries into '${LIBDIR}'"
+source src/libiso8601/soversion
 install_file ${libiso8601} ${LIBDIR} 0755 || return 1
 BASE="${libiso8601_BASE}.so"
 MAJOR="${BASE}.${SOMAJOR}"

From 420df40a5bdc863f57f52608edc8d07fad460818 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 8 Jan 2010 19:22:36 +0000
Subject: [PATCH 11/37] Bring C code up to coding standards

Reformatting and comment improvement only. No code changes.
---
 src/libiso8601/000_TopHeader.h    |   4 +-
 src/libiso8601/000_TopSource.c    |   4 +-
 src/libiso8601/100_calc.c         | 210 +++++++++++++++++-------------
 src/libiso8601/100_leap.c         |  77 +++++++++--
 src/libiso8601/200_parser.c       |  46 ++++---
 src/libiso8601/200_print.c        |  52 +++++---
 src/libiso8601/400_c_library.c    |  30 +++--
 src/libiso8601/400_manip.c        |  43 +++---
 src/libiso8601/999_BottomHeader.h |   4 +-
 9 files changed, 298 insertions(+), 172 deletions(-)

diff --git a/src/libiso8601/000_TopHeader.h b/src/libiso8601/000_TopHeader.h
index 0b8290a..e8badd1 100644
--- a/src/libiso8601/000_TopHeader.h
+++ b/src/libiso8601/000_TopHeader.h
@@ -1,7 +1,7 @@
 /* libiso8601/src/libiso8601/000_TopHeader.h
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
diff --git a/src/libiso8601/000_TopSource.c b/src/libiso8601/000_TopSource.c
index 9a7e9a7..145fb97 100644
--- a/src/libiso8601/000_TopSource.c
+++ b/src/libiso8601/000_TopSource.c
@@ -1,7 +1,7 @@
 /* libiso8601/src/libiso8601/000_TopSource.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
diff --git a/src/libiso8601/100_calc.c b/src/libiso8601/100_calc.c
index 5f3e620..ccf63ae 100644
--- a/src/libiso8601/100_calc.c
+++ b/src/libiso8601/100_calc.c
@@ -1,25 +1,28 @@
 /* libiso8601/src/libiso8601/100_calc.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
 
 
-/* CALCULATION ROUTINES
- *
- *  This file contains calculation routines used internally in the library. Our date format is the
- *  number of days elapsed since 0000-001 (so that date would be 0, -0001-365 would be -1, etc.).
- *  Time is represented as the number of seconds elapsed since midnight at the start of the day. It
- *  is a value between 0 and 86399 (or 86400 for leap seconds).
- */
+/* CALCULATION ROUTINES ********************************************************
+
+ This file contains calculation routines used internally in the library. Our
+date format is the number of days elapsed since 0000-001 (so that date would be
+0, -0001-365 would be -1, etc.).  Time is represented as the number of seconds
+elapsed since midnight at the start of the day. It is a value between 0 and
+86399 (or 86400 for leap seconds).
+
+*******************************************************************************/
 
 #define DAYS_IN_400_YEARS (146097)
 
 
 
-int iso8601_isleap(int year)
+int
+iso8601_isleap(int year)
 {
         if(year % 4) return 0;
         if(year % 100) return 1;
@@ -31,14 +34,15 @@ int iso8601_isleap(int year)
 
 /* struct monthcount, _days_in_month_common[], _days_in_month_leap[]
  *
- *  Tables of the number of days in each month, and the number of days elapsed since the start of
- *  the year for each month.
+ *  Tables of the number of days in each month, and the number of days elapsed
+ *  since the start of the year for each month.
  */
 struct monthcount {
     int elapsed, days;
 };
 
-static const struct monthcount _days_in_month_common[] = {
+static const struct monthcount
+_days_in_month_common[] = {
     { 0, 31 },
     { 31, 28 },
     { 59, 31 },
@@ -53,7 +57,8 @@ static const struct monthcount _days_in_month_common[] = {
     { 334, 31 }
 };
 
-static const struct monthcount _days_in_month_leap[] = {
+static const struct monthcount
+_days_in_month_leap[] = {
     { 0, 31 },
     { 31, 29 },
     { 60, 31 },
@@ -70,7 +75,8 @@ static const struct monthcount _days_in_month_leap[] = {
 
 
 
-static int _days_in_month(int year, int month)
+static int
+_days_in_month(int year, int month)
 {
     const struct monthcount* mc;
 
@@ -85,42 +91,45 @@ static int _days_in_month(int year, int month)
 
 
 
-static void _to_year(int* year, int* days_left, const struct iso8601_date* date)
+static void
+_to_year(int* year, int* days_left, const struct iso8601_date* date)
 {
     div_t qr;
     int ndays = date->day;
 
-    // Each 400 years have 97 leap days, giving 365*400+97 = DAYS_IN_400_YEARS days in 400 years
+    /* Each 400 years have 97 leap days, giving 365*400+97 = DAYS_IN_400_YEARS
+       days in 400 years */
     qr = div(ndays, DAYS_IN_400_YEARS);
     *year = qr.quot * 400;
     ndays = qr.rem;
 
-    // ensure that we always end up with between 0 and 146096 days remaining
+    /* ensure that we always end up with between 0 and 146096 days remaining */
     if(ndays < 0) {
         ndays += DAYS_IN_400_YEARS;
         *year -= 400;
     }
 
-    // we insert `fake' leap days for years 101, 201, 301
+    /* we insert `fake' leap days for years 101, 201, 301 */
     if(ndays >= 36890) ++ndays;
     if(ndays >= 73415) ++ndays;
     if(ndays >= 109940) ++ndays;
 
-    // each remaining 100 year block has 24 leap days, giving 365*100+24 = 36524 days
+    /* each remaining 100 year block has 24 leap days, giving 365*100+24 = 36524
+       days */
     qr = div(ndays, 36525);
     *year += qr.quot * 100;
     ndays = qr.rem;
 
-    // each 4-year block has 1 leap day, giving 365*4 + 1 = 1461 days
+    /* each 4-year block has 1 leap day, giving 365*4 + 1 = 1461 days */
     qr = div(ndays, 1461);
     *year += qr.quot * 4;
     ndays = qr.rem;
 
-    // the first year of a 4-year block has 1 leap day, 366 days
+    /* the first year of a 4-year block has 1 leap day, 366 days */
     if(ndays >= 366) {
-        --ndays; // pretend to have dealt with leap day
+        --ndays; /* pretend to have dealt with leap day */
 
-        // 365 days per remaining year
+        /* 365 days per remaining year */
         qr = div(ndays, 365);
         *year += qr.quot;
         ndays = qr.rem;
@@ -131,15 +140,16 @@ static void _to_year(int* year, int* days_left, const struct iso8601_date* date)
 
 
 
-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)
 {
     const struct monthcount* mc;
     int ndays;
 
-    // perform year calulation
+    /* perform year calulation */
     _to_year(year, &ndays, date);
 
-    // now we simply have number of days elapsed since day 001 in `year'.
+    /* now we simply have number of days elapsed since day 001 in `year'. */
     mc = iso8601_isleap(*year) ? _days_in_month_leap : _days_in_month_common;
     *month = 1;
     while(ndays >= mc->days) {
@@ -152,35 +162,38 @@ void iso8601_to_cal(int* year, int* month, int* day, const struct iso8601_date*
 
 
 
-void iso8601_to_ord(int* year, int* oday, const struct iso8601_date* date)
+void
+iso8601_to_ord(int* year, int* oday, const struct iso8601_date* date)
 {
     int ndays;
 
-    // perform year calcutation
+    /* perform year calcutation */
     _to_year(year, &ndays, date);
 
-    // now we simply have number of days elapsed since day 001 in `year'.
+    /* now we simply have number of days elapsed since day 001 in `year'. */
     *oday = ndays + 1;
 }
 
 
 
-static int _weekday_of_year(int year)
+static int
+_weekday_of_year(int year)
 {
     int w = 6;
 
     /* Algorithm notes:
-     *  - 0 = sun, 1 = mon, ..., 6 = sat
-     *  - 0000-001 is a Saturday, day 6
-     *  - every year we pass gives us one additional day (364 is divisible by 7)
-     *  - but of course every leap year we pass gives us a further day
-     *  - so for every 400 years, we add 497 (400 common years, 97 leap years); 497 % 7 = 0
+     *  • 0 = sun, 1 = mon, ..., 6 = sat
+     *  • 0000-001 is a Saturday, day 6
+     *  • every year we pass gives us one additional day (364 is divisible by 7)
+     *  • but of course every leap year we pass gives us a further day
+     *  • so for every 400 years, we add 497 (400 common years, 97 leap years);
+     *    497 % 7 = 0
      */
     year %= 400;
-    if(year < 0) year += 400; // end up with between 0-399 years left
-    w += year; // excluding leap years, we increase by 1 day a year
-    w += (year + 3) / 4; // there is one leap year for every four years
-    w -= (year - 1) / 100; // but one less for every century over 0
+    if(year < 0) year += 400; /* end up with between 0-399 years left */
+    w += year; /* excluding leap years, we increase by 1 day a year */
+    w += (year + 3) / 4; /* there is one leap year for every four years */
+    w -= (year - 1) / 100; /* but one less for every century over 0 */
     w %= 7;
 
     return w;
@@ -188,42 +201,47 @@ static int _weekday_of_year(int year)
 
 
 
-void iso8601_to_week(int* year, int* week, int* wday, const struct iso8601_date* date)
+void
+iso8601_to_week(int* year, int* week, int* wday,
+    const struct iso8601_date* date)
 {
     int ndays, w, has53 = 0;
     div_t d;
 
-    // perform year and weekday calculation
+    /* perform year and weekday calculation */
     _to_year(year, &ndays, date);
     w = _weekday_of_year(*year);
 
-    // find out what day jan 1 was; from there, we can find the ISO week and year number
+    /* find out what day jan 1 was; from there, we can find the ISO week and
+       year number */
     switch(w) {
-    case 4: // W01 starts XXXY-12-28
+    case 4: /* W01 starts XXXY-12-28 */
         w += 7;
-        has53 = 1; // years starting Thursday have 53 weeks
+        has53 = 1; /* years starting Thursday have 53 weeks */
         break;
 
-    case 5: // W01 starts XXXZ-01-03
-    case 6: // W01 starts XXXZ-01-02
+    case 5: /* W01 starts XXXZ-01-03 */
+    case 6: /* W01 starts XXXZ-01-02 */
         break;
 
-    case 0: // W01 starts XXXZ-01-01
-    case 1: // W01 starts XXXY-12-31
-    case 2: // W01 starts XXXY-12-30
-        w += 7; // for week calculation
+    case 0: /* W01 starts XXXZ-01-01 */
+    case 1: /* W01 starts XXXY-12-31 */
+    case 2: /* W01 starts XXXY-12-30 */
+        w += 7; /* for week calculation */
         break;
 
-    case 3: // W01 starts XXXY-12-29
+    case 3: /* W01 starts XXXY-12-29 */
         w += 7;
-        if(iso8601_isleap(*year)) has53 = 1; // leap years starting Wednesday have 53 weeks
+        if(iso8601_isleap(*year)) has53 = 1; /* leap years starting Wednesday
+                                                have 53 weeks */
     }
 
-    // now we simply add the number of days elapsed since the start of the year, and % 7
+    /* now we simply add the number of days elapsed since the start of the
+       year, and % 7 */
     w += ndays;
-    d = div(w, 7); // w can never be 0
+    d = div(w, 7); /* w can never be 0 */
 
-    // do Sunday correction
+    /* do Sunday correction */
     if(!d.rem) {
         d.rem = 7;
         --d.quot;
@@ -256,54 +274,57 @@ void iso8601_to_week(int* year, int* week, int* wday, const struct iso8601_date*
 
 
 
-int _from_year(struct iso8601_date* date, int year)
+static int
+_from_year(struct iso8601_date* date, int year)
 {
     div_t qr;
 
-    // check for range errors
+    /* check for range errors */
     if(year < -5879609 || year > 5879609) {
         errno = ERANGE;
         return -1;
     }
 
-    // Each 400 years have 97 leap days, giving 365*400+97 = DAYS_IN_400_YEARS days in 400 years
+    /* Each 400 years have 97 leap days, giving 365*400+97 = DAYS_IN_400_YEARS
+       days in 400 years */
     qr = div(year, 400);
     date->day = qr.quot * DAYS_IN_400_YEARS;
     year = qr.rem;
 
-    // ensure we have between 0 and 399 years
+    /* ensure we have between 0 and 399 years */
     if(year < 0) {
         date->day -= DAYS_IN_400_YEARS;
         year += 400;
     }
 
-    // excluding leap days, there are 365 days per year
+    /* excluding leap days, there are 365 days per year */
     date->day += 365 * year;
-    date->day += (year + 3) / 4; // there is one leap year for every four years
-    date->day -= (year - 1) / 100; // but one less for every century over 0
+    date->day += (year + 3) / 4; /* one leap year for every four years */
+    date->day -= (year - 1) / 100; /* but one less for every century over 0 */
     return 0;
 }
 
 
 
-int iso8601_from_cal(struct iso8601_date* date, int year, int month, int day)
+int
+iso8601_from_cal(struct iso8601_date* date, int year, int month, int day)
 {
     const struct monthcount* mc;
 
-    // check for domain errors
+    /* check for domain errors */
     mc = iso8601_isleap(year) ? _days_in_month_leap : _days_in_month_common;
     if(month < 1 || month > 12 || day < 1 || day > mc[month - 1].days) {
         errno = EDOM;
         return -1;
     }
 
-    // perform year calculation
+    /* perform year calculation */
     if(_from_year(date, year)) return -1;
 
-    // now get number of days elapsed up to start of month
+    /* now get number of days elapsed up to start of month */
     date->day += mc[month - 1].elapsed;
 
-    // and add number of days elapsed sinced start of month
+    /* and add number of days elapsed sinced start of month */
     date->day += day - 1;
 
     return 0;
@@ -311,18 +332,19 @@ int iso8601_from_cal(struct iso8601_date* date, int year, int month, int day)
 
 
 
-int iso8601_from_ord(struct iso8601_date* date, int year, int oday)
+int
+iso8601_from_ord(struct iso8601_date* date, int year, int oday)
 {
-    // check for domain errors
+    /* check for domain errors */
     if(oday < 1 || oday > (iso8601_isleap(year) ? 366 : 365)) {
         errno = EDOM;
         return -1;
     }
 
-    // perform year calculation
+    /* perform year calculation */
     if(_from_year(date, year)) return -1;
 
-    // now simply add number of days elapsed this year
+    /* now simply add number of days elapsed this year */
     date->day += oday - 1;
 
     return 0;
@@ -330,18 +352,19 @@ int iso8601_from_ord(struct iso8601_date* date, int year, int oday)
 
 
 
-int iso8601_from_week(struct iso8601_date* date, int isoyear, int week, int wday)
+int
+iso8601_from_week(struct iso8601_date* date, int isoyear, int week, int wday)
 {
     int day1off, maxwk;
 
-    // compute year part
+    /* compute year part */
     _from_year(date, isoyear);
 
-    // 400-year cycle; ensure we're between 0-400 years
+    /* 400-year cycle; ensure we're between 0-400 years */
     isoyear %= 400;
     if(isoyear < 0) isoyear += 400;
 
-    // domain check
+    /* domain check */
     maxwk = (((isoyear % 7) == 52) || ((isoyear % 28) == 24)) ? 53 : 52;
     if(wday < 1 || wday > 7 || week < 1 || week > maxwk) {
         errno = EDOM;
@@ -349,18 +372,20 @@ int iso8601_from_week(struct iso8601_date* date, int isoyear, int week, int wday
     }
 
     /* Algorithm notes:
-     *  We now compute the offset between the start day of the ISO year and the start day of the 
-     *  real year. Year 0000 starts on a Saturday, meaning the ISO year 0000 starts on 0000-003
-     *  (offset of +2 days). Each year reduces the offset by one day, and each leap year reduces it
-     *  by a further day; the offset wraps from -3 to +3.
+     *  We now compute the offset between the start day of the ISO year and
+     *  the start day of the real year. Year 0000 starts on a Saturday, meaning
+     *  the ISO year 0000 starts on 0000-003 (offset of +2 days). Each year
+     *  reduces the offset by one day, and each leap year reduces it by a
+     *  further day; the offset wraps from -3 to +3.
      */
-    day1off = 2 - isoyear; // reduce offset by 1 for each year
-    day1off += (isoyear - 1) / 100; // cancel out 1 leap year for each century past the first
-    day1off -= (isoyear + 3) / 4; // 1 leap year every 4 years
+    day1off = 2 - isoyear; /* reduce offset by 1 for each year */
+    day1off += (isoyear - 1) / 100; /* cancel out 1 leap year for each century
+                                       past the first */
+    day1off -= (isoyear + 3) / 4; /* 1 leap year every 4 years */
     day1off %= 7;
     if(day1off < -3) day1off += 7;
 
-    // now simply add in the day offset and days/weeks elapsed
+    /* now simply add in the day offset and days/weeks elapsed */
     date->day += day1off + (week - 1) * 7 + wday - 1;
 
     return 0;
@@ -368,11 +393,13 @@ int iso8601_from_week(struct iso8601_date* date, int isoyear, 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)
 {
     div_t qr;
 
-    // special case: leap second
+    /* special case: leap second */
     if(date->sec == 86400) {
         *hour = 23;
         *min = 59;
@@ -380,7 +407,7 @@ void iso8601_to_clocktime(int* hour, int* min, int* sec, const struct iso8601_da
         return;
     }
 
-    // normal case
+    /* normal case */
     qr = div(date->sec, 3600);
     *hour = qr.quot;
     qr = div(qr.rem, 60);
@@ -390,21 +417,22 @@ void iso8601_to_clocktime(int* hour, int* min, int* sec, const struct iso8601_da
 
 
 
-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)
 {
-    // special case: leap second
+    /* special case: leap second */
     if(hour == 23 && min == 59 && sec == 60) {
         date->sec = 86400;
         return 0;
     }
 
-    // domain check
+    /* domain check */
     if(hour < 0 || hour > 23 || min < 0 || min > 59 || sec < 0 || sec > 59) {
         errno = EDOM;
         return -1;
     }
     
-    // normal calculation
+    /* normal calculation */
     date->sec = hour * 3600 + min * 60 + sec;
     return 0;
 }
diff --git a/src/libiso8601/100_leap.c b/src/libiso8601/100_leap.c
index cdba1a7..c57dd09 100644
--- a/src/libiso8601/100_leap.c
+++ b/src/libiso8601/100_leap.c
@@ -1,13 +1,20 @@
 /* libiso8601/src/libiso8601/100_leap.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
 
 
-static int leap_second_days_table[] = {
+/* leap_second_days_table[]
+ *  This is a sorted array of days (in libiso8601 format) on which a positive
+ *  leap second occurred. This table is built in to the library, but may be
+ *  overridden at runtime by changing what ‘leap_second_days’ points to. There
+ *  should be no other references to this table, therefore.
+ */
+static int
+leap_second_days_table[] = {
     720439, /* 1972-06-30 */
     720623, /* 1972-12-31 */
     720988, /* 1973-12-31 */
@@ -36,21 +43,41 @@ static int leap_second_days_table[] = {
 
 
 
-static int* leap_second_days = leap_second_days_table;
-static int leap_second_days_num = sizeof(leap_second_days_table) / sizeof(int);
+/* leap_second_days[], leap_second_days_num
+ *  Pointer to an array (and number of elements in the array) representing the
+ *  table of positive leap seconds. The array is sorted and contains libiso8601
+ *  day numbers of days with positive leap seconds.
+ */
+static int*
+leap_second_days = leap_second_days_table;
+static int
+leap_second_days_num = sizeof(leap_second_days_table) / sizeof(int);
 
 
 
-int iso8601_seconds_leap(const struct iso8601_date* date)
+/* iso8601_seconds_leap()
+ *  Returns the number of seconds that elapse on a given date, which requires us
+ *  to search the table of leap seconds to see if we need to return a special
+ *  case.
+ */
+int
+iso8601_seconds_leap(const struct iso8601_date* date)
 {
     int i;
-    for(i = 0; i < leap_second_days_num; ++i) if(leap_second_days[i] == date->day) return 86401;
+    for(i = 0; i < leap_second_days_num; ++i) {
+        if(leap_second_days[i] == date->day) return 86401;
+    }
     return 86400;
 }
 
 
 
-static int _leap_elapsed_day(int sday, int eday)
+/* _leap_elapsed_day()
+ *  Returns the number of leap seconds that have elapsed between ‘sday’ (start
+ *  day) and ‘eday’ (end day), both in libiso8601 format.
+ */
+static int
+_leap_elapsed_day(int sday, int eday)
 {
     int spos, epos;
 
@@ -66,16 +93,31 @@ static int _leap_elapsed_day(int sday, int eday)
 
 
 
-int iso8601_leap_elapsed(const struct iso8601_date* start, const struct iso8601_date* end)
+/* iso8601_leap_elapsed()
+ *  Wrapper around _leap_elapsed_day().
+ */
+int
+iso8601_leap_elapsed(const struct iso8601_date* start,
+    const struct iso8601_date* end)
 {
     return _leap_elapsed_day(start->day, end->day);
 }
 
 
 
+/* leap_table_free_old
+ *  If set, then when we update the leap table, we should free the old array.
+ *  Initially clear so that we don't free our static built-in table.
+ */
 static int leap_table_free_old = 0;
 
-void iso8601_leap_table_set(int* new_table, int new_size)
+
+
+/* iso8601_leap_table_set()
+ *  Switch to using a new table of leap seconds, possibly freeing the old one.
+ */
+void
+iso8601_leap_table_set(int* new_table, int new_size)
 {
     if(leap_table_free_old) free(leap_second_days);
     leap_table_free_old = 0;
@@ -86,11 +128,22 @@ void iso8601_leap_table_set(int* new_table, int new_size)
 
 
 
-static const char* leap_table_signature = "/O9PdPZI";
+/* leap_table_signature
+ *  The first 8 bytes of a leap second table must match this string, otherwise
+ *  the file is taken not to be of the correct format.
+ */
+static const char*
+leap_table_signature = "/O9PdPZI";
 
 
 
-int iso8601_leap_table_load(const char* fname)
+/* iso8601_leap_table_load()
+ *  Loads a new table of leap seconds from disk. Ensures the signature of the
+ *  given file matches ‘leap_table_signature’, and does some basic sanity
+ *  checking (file in sorted order etc.).
+ */
+int
+iso8601_leap_table_load(const char* fname)
 {
     struct stat st;
     int fd, saved_errno, i, new_size, * days = 0;
diff --git a/src/libiso8601/200_parser.c b/src/libiso8601/200_parser.c
index 8a8aba9..78e17a4 100644
--- a/src/libiso8601/200_parser.c
+++ b/src/libiso8601/200_parser.c
@@ -1,24 +1,25 @@
 /* libiso8601/src/libiso8601/200_parser.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
 
 
-int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601_date* latest,
-    struct iso8601_details* details)
+int
+iso8601_parse(const char* str, struct iso8601_date* earliest,
+    struct iso8601_date* latest, struct iso8601_details* details)
 {
     enum {
         state_none,
-        state_year, // e.g. `2006' or `2006123'
-        state_date2, // 2nd component of date, e.g. `2006-' or `2006-1'
-        state_day, // e.g. `2006-01-' or `2006-01-01'
-        state_week_basic, // e.g. `2006W' or `2006W123'
-        state_week_extended, // e.g. `2006-W' or `2006-W31'
-        state_week_day, // e.g. `2006-W31-'
-        state_week_done, // `2006-W31-1'
+        state_year, /* e.g. `2006' or `2006123' */
+        state_date2, /* 2nd component of date, e.g. `2006-' or `2006-1' */
+        state_day, /* e.g. `2006-01-' or `2006-01-01' */
+        state_week_basic, /* e.g. `2006W' or `2006W123' */
+        state_week_extended, /* e.g. `2006-W' or `2006-W31' */
+        state_week_day, /* e.g. `2006-W31-' */
+        state_week_done, /* `2006-W31-1' */
         state_time_basic,
         state_time_hour,
         state_time_min,
@@ -34,8 +35,9 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
 
     div_t qr;
     char ch;
-    int num = 0, neg = 0, dig = 0, tz_neg = 0, nsec = -1, nsec_dig = -1, leap_sec_req = 0;
-    int y = 0, m = -1, d = -1, w = -1, wd = -1, hour = -1, min = -1, sec = -1, tz_sec = 0;
+    int num = 0, neg = 0, dig = 0, tz_neg = 0, nsec = -1, nsec_dig = -1,
+        leap_sec_req = 0, y = 0, m = -1, d = -1, w = -1, wd = -1, hour = -1,
+        min = -1, sec = -1, tz_sec = 0;
     double frac;
     struct iso8601_elapsed elapsed;
 
@@ -436,7 +438,8 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
             case '-':
                 tz_neg = -1;
             case '+':
-                state = (state == state_time_nsec_basic) ? state_tz_basic : state_tz_hour;
+                state = (state == state_time_nsec_basic) ?
+                    state_tz_basic : state_tz_hour;
                 break;
             }
             break;
@@ -544,7 +547,8 @@ done:
     if(m != -1) {
         if(d == -1) {
             ERROR_IF(earliest && iso8601_from_cal(earliest, y, m, 1));
-            ERROR_IF(latest && iso8601_from_cal(latest, y, m, _days_in_month(y, m)));
+            ERROR_IF(latest && iso8601_from_cal(latest, y, m,
+                _days_in_month(y, m)));
             if(details) details->date_prec = iso8601_prec_month;
 
         } else {
@@ -608,7 +612,8 @@ done:
 
     } else if(min != -1) {
         if(nsec_dig == -1) {
-            ERROR_IF(earliest && iso8601_from_clocktime(earliest, hour, min, 0));
+            ERROR_IF(earliest && iso8601_from_clocktime(earliest,
+                hour, min, 0));
             ERROR_IF(latest && iso8601_from_clocktime(latest, hour, min, 59));
             if(latest) latest->nsec = 999999999;
             if(details) details->time_prec = iso8601_prec_min;
@@ -617,7 +622,8 @@ done:
             frac = nsec * 60.0 / 1e9;
             sec = (int)frac;
             nsec = (frac - sec) * 1e9;
-            ERROR_IF(earliest && iso8601_from_clocktime(earliest, hour, min, sec));
+            ERROR_IF(earliest && iso8601_from_clocktime(earliest,
+                hour, min, sec));
             if(earliest) earliest->nsec = nsec;
             ERROR_IF(latest && iso8601_from_clocktime(latest, hour, min, sec));
             if(latest) latest->nsec = nsec;
@@ -639,7 +645,8 @@ done:
             frac *= 60;
             sec = (int)frac;
             nsec = (frac - sec) * 1e9;
-            ERROR_IF(earliest && iso8601_from_clocktime(earliest, hour, min, sec));
+            ERROR_IF(earliest && iso8601_from_clocktime(earliest,
+                hour, min, sec));
             if(earliest) earliest->nsec = nsec;
             ERROR_IF(latest && iso8601_from_clocktime(latest, hour, min, sec));
             if(latest) latest->nsec = nsec;
@@ -676,7 +683,8 @@ done:
 
 
 
-int iso8601_invalid(const struct iso8601_date* date)
+int
+iso8601_invalid(const struct iso8601_date* date)
 {
     return date->nsec < 0
         || date->nsec >= BILLION
diff --git a/src/libiso8601/200_print.c b/src/libiso8601/200_print.c
index 759bc49..e6b3f80 100644
--- a/src/libiso8601/200_print.c
+++ b/src/libiso8601/200_print.c
@@ -1,13 +1,18 @@
-/* libiso8601/src/libiso8601/print.c
+/* libiso8601/src/libiso8601/200_print.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
 
 
-static const struct iso8601_details _default_details = {
+/* _default_details
+ *  If the user doesn't pass precision details to iso8601_print(), these are
+ *  used instead.
+ */
+static const struct iso8601_details
+_default_details = {
     iso8601_prec_day,
     iso8601_prec_sec,
     1,
@@ -16,7 +21,8 @@ static const struct iso8601_details _default_details = {
 
 
 
-char* iso8601_print(char* str, int amt, const struct iso8601_date* date, 
+char*
+iso8601_print(char* str, int amt, const struct iso8601_date* date, 
     const struct iso8601_details* details)
 {
     int y, m, d, ret = 0, extended;
@@ -27,10 +33,10 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date,
 
     str_orig = str;
 
-    // use default details if none provided
+    /* use default details if none provided */
     if(!details) details = &_default_details;
 
-    // adjust output for timezone
+    /* adjust output for timezone */
     dttz = *date;
     if(details->tz_sec) {
         elapsed.sec = details ? details->tz_sec : 0;
@@ -38,7 +44,7 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date,
         iso8601_add_elapsed(&dttz, &elapsed);
     }
 
-    // determine whether or not to force extended output
+    /* determine whether or not to force extended output */
     iso8601_to_cal(&y, &m, &d, &dttz);
     extended = details->extended || y < 0 || y > 9999;
 
@@ -55,27 +61,32 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date,
 
     case iso8601_prec_day:
         if(y < 0) ret = snprintf(str, amt, "%05d-%02d-%02d", y, m, d);
-        else ret = snprintf(str, amt, extended ? "%04d-%02d-%02d" : "%04d%02d%02d", y, m, d);
+        else ret = snprintf(str, amt, extended ?
+            "%04d-%02d-%02d" : "%04d%02d%02d", y, m, d);
         break;
 
     case iso8601_prec_ord:
         iso8601_to_ord(&y, &d, &dttz);
         if(y < 0) ret = snprintf(str, amt, "%05d-%03d", y, d);
-        else ret = snprintf(str, amt, extended ? "%04d-%03d" : "%04d%03d", y, d);
+        else ret = snprintf(str, amt, extended ?
+            "%04d-%03d" : "%04d%03d", y, d);
         break;
 
     case iso8601_prec_week:
         iso8601_to_week(&y, &m, &d, &dttz);
-        extended = y < 0 || y > 9999 || details->extended; // ISO year is different
+        /* note: ISO year can differ, so recompute extended flag */
+        extended = y < 0 || y > 9999 || details->extended;
         if(y < 0) snprintf(str, amt, "%05d-W%02d", y, m);
         else snprintf(str, amt, extended ? "%04d-W%02d" : "%04dW%02d", y, m);
         return str_orig;
 
     case iso8601_prec_wday:
         iso8601_to_week(&y, &m, &d, &dttz);
-        extended = y < 0 || y > 9999 || details->extended; // ISO year is different
+        /* note: ISO year can differ, so recompute extended flag */
+        extended = y < 0 || y > 9999 || details->extended;
         if(y < 0) ret = snprintf(str, amt, "%05d-W%02d-%d", y, m, d);
-        else ret = snprintf(str, amt, extended ? "%04d-W%02d-%d" : "%04dW%02d%d", y, m, d);
+        else ret = snprintf(str, amt, extended ?
+            "%04d-W%02d-%d" : "%04dW%02d%d", y, m, d);
         break;
     }
 
@@ -111,7 +122,8 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date,
         break;
 
     case iso8601_prec_sec:
-        ret = snprintf(str, amt, extended ? "T%02d:%02d:%02d" : "T%02d%02d%02d", y, m, d);
+        ret = snprintf(str, amt, extended ?
+            "T%02d:%02d:%02d" : "T%02d%02d%02d", y, m, d);
         break;
 
     case iso8601_prec_hourfrac:
@@ -121,12 +133,14 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date,
 
     case iso8601_prec_minfrac:
         frac = m + (d + date->nsec / 1e9) / 60.0;
-        ret = snprintf(str, amt, extended ? "T%02d:%#012.9f" : "T%02d%#012.9f", y, frac);
+        ret = snprintf(str, amt, extended ?
+            "T%02d:%#012.9f" : "T%02d%#012.9f", y, frac);
         break;
 
     case iso8601_prec_secfrac:
         frac = d + date->nsec / 1e9;
-        ret = snprintf(str, amt, extended ? "T%02d:%02d:%#012.9f" : "T%02d%02d%#012.9f", y, m, frac);
+        ret = snprintf(str, amt, extended ?
+            "T%02d:%02d:%#012.9f" : "T%02d%02d%#012.9f", y, m, frac);
         break;
     }
 
@@ -150,8 +164,10 @@ char* iso8601_print(char* str, int amt, const struct iso8601_date* date,
         ret -= m * 60;
         d = ret;
 
-        if(d) snprintf(str, amt, extended ? "%02d:%02d:%02d" : "%02d%02d%02d", y, m, d);
-        else if(m) snprintf(str, amt, extended ? "%02d:%02d" : "%02d%02d", y, m);
+        if(d) snprintf(str, amt, extended ?
+            "%02d:%02d:%02d" : "%02d%02d%02d", y, m, d);
+        else if(m) snprintf(str, amt, extended ?
+            "%02d:%02d" : "%02d%02d", y, m);
         else snprintf(str, amt, "%02d", y);
     } else {
         *str++ = 'Z';
diff --git a/src/libiso8601/400_c_library.c b/src/libiso8601/400_c_library.c
index e960c34..0d810af 100644
--- a/src/libiso8601/400_c_library.c
+++ b/src/libiso8601/400_c_library.c
@@ -1,16 +1,17 @@
 /* libiso8601/src/libiso8601/400_c_library.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
-// days between 0000-001 and 1970-001 (the unix epoch)
+/* days between 0000-001 and 1970-001 (the unix epoch) */
 #define EPOCH_GDAY (719528)
 
 
 
-void iso8601_now(struct iso8601_date* date, struct iso8601_details* details)
+void
+iso8601_now(struct iso8601_date* date, struct iso8601_details* details)
 {
     static int use_gettimeofday = 0;
     struct timespec ts;
@@ -44,7 +45,8 @@ void iso8601_now(struct iso8601_date* date, struct iso8601_details* details)
 
 
 
-int iso8601_set_sysclock(const struct iso8601_date* date)
+int
+iso8601_set_sysclock(const struct iso8601_date* date)
 {
     static int use_settimeofday = 0;
     struct timeval tv;
@@ -71,7 +73,8 @@ int iso8601_set_sysclock(const struct iso8601_date* date)
 
 
 
-void iso8601_from_ts(struct iso8601_date* date, const struct timespec* ts)
+void
+iso8601_from_ts(struct iso8601_date* date, const struct timespec* ts)
 {
     ldiv_t qr;
 
@@ -83,7 +86,8 @@ 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_to_ts(struct timespec* ts, const struct iso8601_date* date)
 {
     ts->tv_sec = 86400L * (date->day - EPOCH_GDAY) + date->sec;
     ts->tv_nsec = date->nsec;
@@ -91,7 +95,8 @@ void iso8601_to_ts(struct timespec* ts, const struct iso8601_date* date)
 
 
 
-void iso8601_from_tv(struct iso8601_date* date, const struct timeval* tv)
+void
+iso8601_from_tv(struct iso8601_date* date, const struct timeval* tv)
 {
     ldiv_t qr;
 
@@ -103,7 +108,8 @@ void iso8601_from_tv(struct iso8601_date* date, const struct timeval* tv)
 
 
 
-void iso8601_to_tv(struct timeval* tv, const struct iso8601_date* date)
+void
+iso8601_to_tv(struct timeval* tv, const struct iso8601_date* date)
 {
     tv->tv_sec = 86400L * (date->day - EPOCH_GDAY) + date->sec;
     tv->tv_usec = date->nsec / 1000;
@@ -111,7 +117,8 @@ void iso8601_to_tv(struct timeval* tv, const struct iso8601_date* date)
 
 
 
-void iso8601_from_time_t(struct iso8601_date* date, const time_t* t)
+void
+iso8601_from_time_t(struct iso8601_date* date, const time_t* t)
 {
     ldiv_t qr;
 
@@ -123,7 +130,8 @@ 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)
+void
+iso8601_to_time_t(time_t* t, const struct iso8601_date* date)
 {
     *t = 86400L * (date->day - EPOCH_GDAY) + date->sec;
 }
diff --git a/src/libiso8601/400_manip.c b/src/libiso8601/400_manip.c
index 40a0dd8..60c97cf 100644
--- a/src/libiso8601/400_manip.c
+++ b/src/libiso8601/400_manip.c
@@ -1,13 +1,14 @@
 /* libiso8601/src/libiso8601/400_manip.c
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
 
 
-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)
 {
     if(d1->day < d2->day) return 1;
     if(d1->day > d2->day) return 0;
@@ -19,7 +20,8 @@ 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)
 {
     if(d1->day < d2->day) return 1;
     if(d1->day > d2->day) return 0;
@@ -31,14 +33,17 @@ int iso8601_lte(const struct iso8601_date* d1, const struct iso8601_date* d2)
 
 
 
-int iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2)
+int
+iso8601_eq(const struct iso8601_date* d1, const struct iso8601_date* d2)
 {
-    return (d1->day == d2->day) && (d1->sec == d2->sec) && (d1->nsec == d2->nsec);
+    return (d1->day == d2->day) && (d1->sec == d2->sec)
+        && (d1->nsec == d2->nsec);
 }
 
 
 
-int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2)
+int
+iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2)
 {
     if(d1->day < d2->day) return -1;
     if(d1->day > d2->day) return 1;
@@ -51,12 +56,14 @@ int iso8601_cmp(const struct iso8601_date* d1, const struct iso8601_date* d2)
 
 
 
-void iso8601_add_elapsed(struct iso8601_date* date, const struct iso8601_elapsed* per)
+void
+iso8601_add_elapsed(struct iso8601_date* date,
+    const struct iso8601_elapsed* per)
 {
     div_t qr;
     int leapcorrect;
 
-    /* work out number to advance `day' by */
+    /* work out number to advance ‘day’ by */
     qr = div(per->sec, 86400);
     leapcorrect = _leap_elapsed_day(date->day, date->day + qr.quot);
     date->day += qr.quot;
@@ -81,12 +88,14 @@ void iso8601_add_elapsed(struct iso8601_date* date, const struct iso8601_elapsed
 
 
 
-void iso8601_subtract_elapsed(struct iso8601_date* date, const struct iso8601_elapsed* per)
+void 
+iso8601_subtract_elapsed(struct iso8601_date* date,
+    const struct iso8601_elapsed* per)
 {
     div_t qr;
     int leapcorrect;
 
-    /* work out number to advance `day' by */
+    /* work out number to advance ‘day’ by */
     qr = div(per->sec, 86400);
     leapcorrect = _leap_elapsed_day(date->day - qr.quot, date->day);
     date->day -= qr.quot;
@@ -111,7 +120,9 @@ void iso8601_subtract_elapsed(struct iso8601_date* date, const struct iso8601_el
 
 
 
-void iso8601_add_multiple(struct iso8601_date* date, const struct iso8601_elapsed* per, int n)
+void
+iso8601_add_multiple(struct iso8601_date* date,
+    const struct iso8601_elapsed* per, int n)
 {
     long long nsec;
     lldiv_t qr;
@@ -128,7 +139,8 @@ void iso8601_add_multiple(struct iso8601_date* date, const struct iso8601_elapse
 
 
 
-void iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date* d2,
+void
+iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date* d2,
     struct iso8601_elapsed* per, int* sign)
 {
     const struct iso8601_date* e1, * e2;
@@ -160,8 +172,9 @@ void iso8601_difference(const struct iso8601_date* d1, const struct iso8601_date
 
 
 
-int iso8601_elapsed_div(const struct iso8601_elapsed* num, const struct iso8601_elapsed* denom,
-    struct iso8601_elapsed* remain)
+int
+iso8601_elapsed_div(const struct iso8601_elapsed* num,
+    const struct iso8601_elapsed* denom, struct iso8601_elapsed* remain)
 {
     unsigned long long pnum, pdenom;
     lldiv_t val, v2;
diff --git a/src/libiso8601/999_BottomHeader.h b/src/libiso8601/999_BottomHeader.h
index 091ffa7..8a738c5 100644
--- a/src/libiso8601/999_BottomHeader.h
+++ b/src/libiso8601/999_BottomHeader.h
@@ -1,7 +1,7 @@
 /* libiso8601/src/libiso8601/999_BottomHeader.h
  *
- *  (c)2006, Laurence Withers, .
- *  Released under the GNU GPLv2. See file COPYING or
+ *  (c)2006-2010, Laurence Withers, .
+ *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 

From bd4ddd76211ca184e9947b57d6bc3a51e2f8147a Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 8 Jan 2010 19:25:58 +0000
Subject: [PATCH 12/37] Write brief description for library

Add a brief description of the library on the doxygen front page.
---
 src/docs/MainPage.dox | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/docs/MainPage.dox b/src/docs/MainPage.dox
index 29af7e0..7df3bc0 100644
--- a/src/docs/MainPage.dox
+++ b/src/docs/MainPage.dox
@@ -1,11 +1,16 @@
 /* libiso8601/src/docs/MainPage.dox
  *
- *  (c)2007, Laurence Withers, .
+ *  (c)2007-2010, Laurence Withers, .
  *  Released under the GNU GPLv3. See file COPYING or
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
-/*! \mainpage
+/*! \mainpage Library for manipulating ISO8601-format dates and times
+
+\c libiso8601 is a library containing conversion routines for ISO8601-format
+dates and times and a set of associated date/time manipulation routines. It has
+support for leap seconds and nanosecond accuracy and is intended for use in
+e.g. physical science applications.
 
 */
 

From ed05b5c872c3624311d9bec71887b8472bf6b715 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 8 Jan 2010 19:26:21 +0000
Subject: [PATCH 13/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index bb1611e..20cd179 100644
--- a/version
+++ b/version
@@ -11,7 +11,7 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=7
+VERMICRO=8
 
 # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4:syntax=sh

From cd9a2d252a57c30417f67e92e42ccdcaad3b5f51 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Thu, 28 Jan 2010 16:17:53 +0000
Subject: [PATCH 14/37] iso8601_difference(): incorrect nonnull attribute

iso8601_difference was incorrectly marked as having all of its attributes
required to be non-null, but this is not the case according to the docs or
the implementation. This was causing a crash as the compiled library was
taking advantage of the nonnull notation to remove some tests against null
which, according to the docs, are actually required.

Fix by tightening the nonnull specification to those parameters which actually
require it.
---
 src/libiso8601/400_manip.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libiso8601/400_manip.h b/src/libiso8601/400_manip.h
index 2f45e2e..57f3a39 100644
--- a/src/libiso8601/400_manip.h
+++ b/src/libiso8601/400_manip.h
@@ -148,7 +148,7 @@ stored in \a sign (if it is not a null pointer), i.e. -1 if \a d2 > \a d1 or
 void iso8601_difference(const struct iso8601_date* d1,
     const struct iso8601_date* d2, struct iso8601_elapsed* per, int* sign)
 #ifndef DOXYGEN
-    __attribute__((nonnull))
+    __attribute__((nonnull(1,2)))
 #endif
 ;
 

From 64e06d17c44afa40c9bff0d70414daeefd21b0d8 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Thu, 28 Jan 2010 16:22:03 +0000
Subject: [PATCH 15/37] Add explicit note on params which may be null

---
 src/libiso8601/400_c_library.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libiso8601/400_c_library.h b/src/libiso8601/400_c_library.h
index 1a75cd0..f7abd38 100644
--- a/src/libiso8601/400_c_library.h
+++ b/src/libiso8601/400_c_library.h
@@ -19,8 +19,8 @@ conversion).
 
 /*! \brief Retrieve the current time.
 
-\param[out] date Current date/time (may be 0), in UTC.
-\param[out] details Details (may be 0), including timezone.
+\param[out] date Current date/time (may be 0), in UTC. May be 0.
+\param[out] details Details (may be 0), including timezone. May be 0.
 
 Retrieves the current time from the system clock, storing it into \a date and
 \a details (both parameters optional).

From 65fe61327241efb8857570f917c45502c55ff526 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Thu, 28 Jan 2010 16:22:39 +0000
Subject: [PATCH 16/37] Bump version

---
 src/libiso8601/soversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion
index a37b99a..4d89b43 100644
--- a/src/libiso8601/soversion
+++ b/src/libiso8601/soversion
@@ -12,4 +12,4 @@
 SOMAJOR=1
 
 # SOMICRO is bumped every time there is a binary-compatible release.
-SOMICRO=5
+SOMICRO=6

From 0d56edd89053b4e382bc5fa18fd03890ed3b29fa Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Thu, 28 Jan 2010 16:22:46 +0000
Subject: [PATCH 17/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index 20cd179..16bb85c 100644
--- a/version
+++ b/version
@@ -11,7 +11,7 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=8
+VERMICRO=9
 
 # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4:syntax=sh

From 944331702f7bbb2ff3f77109b617864dad0d1b8c Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 18 Jun 2010 12:47:38 +0000
Subject: [PATCH 18/37] Cope with negative C library timestamps

While perhaps not strictly valid, negative timestamps can potentially be
returned by the C library and passed in to iso8601_from_ts() etc. This commit
adds a check for such timestamps and copes with the gracefully, whereas
previously invalid ISO8601 timestamps would have been generated.
---
 src/libiso8601/400_c_library.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/libiso8601/400_c_library.c b/src/libiso8601/400_c_library.c
index 0d810af..effd788 100644
--- a/src/libiso8601/400_c_library.c
+++ b/src/libiso8601/400_c_library.c
@@ -22,7 +22,8 @@ iso8601_now(struct iso8601_date* date, struct iso8601_details* details)
     if(use_gettimeofday || clock_gettime(CLOCK_REALTIME, &ts)) {
         use_gettimeofday = 1;
         gettimeofday(&tv, 0);
-        ts.tv_sec = tv.tv_sec;
+        if(tv.tv_sec < 0) ts.tv_sec = 0;
+        else ts.tv_sec = tv.tv_sec;
         ts.tv_nsec = tv.tv_usec * 1000L;
     }
 
@@ -79,6 +80,10 @@ iso8601_from_ts(struct iso8601_date* date, const struct timespec* ts)
     ldiv_t qr;
 
     qr = ldiv(ts->tv_sec, 86400);
+    if(ts->tv_sec < 0) {
+        --qr.quot;
+        qr.rem += 86400;
+    }
     date->day = EPOCH_GDAY + qr.quot;
     date->sec = qr.rem;
     date->nsec = ts->tv_nsec;
@@ -101,6 +106,10 @@ iso8601_from_tv(struct iso8601_date* date, const struct timeval* tv)
     ldiv_t qr;
 
     qr = ldiv(tv->tv_sec, 86400);
+    if(tv->tv_sec < 0) {
+        --qr.quot;
+        qr.rem += 86400;
+    }
     date->day = EPOCH_GDAY + qr.quot;
     date->sec = qr.rem;
     date->nsec = tv->tv_usec * 1000;
@@ -123,6 +132,10 @@ iso8601_from_time_t(struct iso8601_date* date, const time_t* t)
     ldiv_t qr;
 
     qr = ldiv(*t, 86400);
+    if(*t < 0) {
+        --qr.quot;
+        qr.rem += 86400;
+    }
     date->day = EPOCH_GDAY + qr.quot;
     date->sec = qr.rem;
     date->nsec = 0;

From 2d9621e0a529413ed64421d383bf1e0819b445e5 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 18 Jun 2010 12:49:33 +0000
Subject: [PATCH 19/37] Bump version

---
 src/libiso8601/soversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion
index 4d89b43..f513915 100644
--- a/src/libiso8601/soversion
+++ b/src/libiso8601/soversion
@@ -12,4 +12,4 @@
 SOMAJOR=1
 
 # SOMICRO is bumped every time there is a binary-compatible release.
-SOMICRO=6
+SOMICRO=7

From 8cc71fb06964cd62d0ea51e4c44f1ff778f3c0b0 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 18 Jun 2010 12:49:36 +0000
Subject: [PATCH 20/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index 16bb85c..4d4c3cb 100644
--- a/version
+++ b/version
@@ -11,7 +11,7 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=9
+VERMICRO=10
 
 # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4:syntax=sh

From d013bff2636b10452af8412483be9f844957eece Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Mon, 2 Aug 2010 12:00:20 +0000
Subject: [PATCH 21/37] Remove incorrect nonnull attribute
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

iso8601_leap_table_load() had an incorrect ‘nonnull’ attribute, which could
lead to crashes as the compiled code could omit the test for null which then
substitutes the system default. Fix it by removing the attribute.
---
 src/libiso8601/400_leap.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/libiso8601/400_leap.h b/src/libiso8601/400_leap.h
index 2797464..f9bb4ca 100644
--- a/src/libiso8601/400_leap.h
+++ b/src/libiso8601/400_leap.h
@@ -124,11 +124,7 @@ be set appropriately. If \a errno is \c EINVAL, then the file does not contain
 a valid leap second table.
 
 */
-int iso8601_leap_table_load(const char* fname)
-#ifndef DOXYGEN
-    __attribute__((nonnull))
-#endif
-;
+int iso8601_leap_table_load(const char* fname);
 
 
 

From 2aa3d5aaac003b1abfd5fdb96fec170f122131d1 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Mon, 2 Aug 2010 12:01:43 +0000
Subject: [PATCH 22/37] Bump version

---
 src/libiso8601/soversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion
index f513915..06bbd00 100644
--- a/src/libiso8601/soversion
+++ b/src/libiso8601/soversion
@@ -12,4 +12,4 @@
 SOMAJOR=1
 
 # SOMICRO is bumped every time there is a binary-compatible release.
-SOMICRO=7
+SOMICRO=8

From d910e88bc32f677a93cdb609d82fab0d3255c89b Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Mon, 2 Aug 2010 12:01:43 +0000
Subject: [PATCH 23/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index 4d4c3cb..eabca08 100644
--- a/version
+++ b/version
@@ -11,7 +11,7 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=10
+VERMICRO=11
 
 # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4:syntax=sh

From 7a5f30bfcde937a0e0679c2c70b640aaadc106cd Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Tue, 15 Nov 2011 16:46:53 +0000
Subject: [PATCH 24/37] Update build system

---
 make.sh                          |  1 -
 run-test.sh                      | 16 ++++++++--------
 scripts/.gitignore               |  1 +
 scripts/functions.sh             |  7 +++----
 scripts/paths                    |  7 +++----
 src/docs/build.docs              |  1 -
 src/docs/build.install-docs      |  1 -
 src/isodate/build.app            |  6 ++----
 src/isodate/build.install-app    |  1 -
 src/isodate/build.monolithic     |  1 -
 src/libiso8601/build.install-lib |  1 -
 src/libiso8601/build.lib         |  5 +++--
 src/libiso8601/build.monolithic  |  1 -
 src/libiso8601/config-script     |  1 -
 src/libiso8601/soversion         |  6 +++---
 src/setisodate/build.app         |  6 ++----
 src/setisodate/build.install-app |  1 -
 src/setisodate/build.monolithic  |  1 -
 src/tests/build.default          |  2 --
 src/tests/build.tests            | 10 ++--------
 src/tests/template               | 16 +++++++++-------
 version                          |  9 ++++-----
 22 files changed, 40 insertions(+), 61 deletions(-)

diff --git a/make.sh b/make.sh
index 7d11652..343e4b8 100755
--- a/make.sh
+++ b/make.sh
@@ -292,5 +292,4 @@ done
 
 exit 0
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4
diff --git a/run-test.sh b/run-test.sh
index cb337f2..cf2eb87 100755
--- a/run-test.sh
+++ b/run-test.sh
@@ -1,9 +1,9 @@
 #!/bin/bash
 # libiso8601/test.sh
-#
-#  (c)2009, Laurence Withers, .
-#  Released under the GNU GPLv3. See file COPYING or
-#  http://www.gnu.org/copyleft/gpl.html for details.
+# 
+#  Copyright: ©2009–2011, Güralp Systems Ltd.
+#  Author: Laurence Withers 
+#  License: GPLv3
 #
 
 # Running this script on its own will display a summary of all the
@@ -21,7 +21,7 @@ run_test() {
         return 1
     fi
 
-    LD_LIBRARY_PATH="obj" "${EXE}" "$@" || return 1
+    LD_LIBRARY_PATH="obj:${LD_LIBRARY_PATH}" "${EXE}" "$@" || return 1
     return 0
 }
 
@@ -36,11 +36,12 @@ print_tests() {
         [ -x "${EXE}" ] || continue
         NAME="$(echo "${EXE}" | sed 's,obj/tests/,,')"
         echo -ne "${NAME}\t"
-        LD_LIBRARY_PATH="obj" "${EXE}" --print-summary
+        LD_LIBRARY_PATH="obj:${LD_LIBRARY_PATH}" "${EXE}" --print-summary
     done
 }
 
 
+
 # Main script
 if [ $# -eq 0 ]
 then
@@ -48,7 +49,6 @@ then
     exit 0
 fi
 
-run_test $*
+run_test "$@"
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4
diff --git a/scripts/.gitignore b/scripts/.gitignore
index edcbbeb..b9fcf56 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -7,6 +7,7 @@ build.docs.none
 build.files.none
 build.firmware.gpasm
 build.firmware.sdcc
+build.header.c
 build.lib.c
 build.lib.c++
 build.make.none
diff --git a/scripts/functions.sh b/scripts/functions.sh
index df3e35f..583d2bd 100755
--- a/scripts/functions.sh
+++ b/scripts/functions.sh
@@ -1,8 +1,8 @@
 # libiso8601/scripts/functions.sh
 #
-#  (c)2007, Laurence Withers, .
-#  Released under the GNU GPLv3. See file COPYING or
-#  http://www.gnu.org/copyleft/gpl.html for details.
+#  Copyright: ©2007–2011, Güralp Systems Ltd.
+#  Author: Laurence Withers, 
+#  License: GPLv3
 #
 
 # Common functions
@@ -63,5 +63,4 @@ do_cmd_redir() {
     fi
 }
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4
diff --git a/scripts/paths b/scripts/paths
index 0975fc2..76be405 100644
--- a/scripts/paths
+++ b/scripts/paths
@@ -1,8 +1,8 @@
 # libiso8601/scripts/paths
 #
-#  (c)2007, Laurence Withers, .
-#  Released under the GNU GPLv3. See file COPYING or
-#  http://www.gnu.org/copyleft/gpl.html for details.
+#  Copyright: ©2011, Güralp Systems Ltd.
+#  Author: Laurence Withers, 
+#  License: GPLv3
 #
 #  Default path setup. Not meant for editing; use environment variables 
 #  to override values if needed.
@@ -60,5 +60,4 @@ fi
 [ -z "${WEBDIR}" ] && WEBDIR="${SRVDIR}/http"
 [ -z "${CGIDIR}" ] && CGIDIR="${WEBDIR}/cgi-bin"
  
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/docs/build.docs b/src/docs/build.docs
index 98d0570..d4494bf 100644
--- a/src/docs/build.docs
+++ b/src/docs/build.docs
@@ -39,5 +39,4 @@ then
     docs_BUILT=1
 fi
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/docs/build.install-docs b/src/docs/build.install-docs
index 28f5f18..b07c940 100644
--- a/src/docs/build.install-docs
+++ b/src/docs/build.install-docs
@@ -17,5 +17,4 @@ do
 done
 
 print_success "Documentation installed"
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/isodate/build.app b/src/isodate/build.app
index 071ec61..b4eb742 100644
--- a/src/isodate/build.app
+++ b/src/isodate/build.app
@@ -3,12 +3,11 @@
 #  isodate_BUILT
 #
 
-build_target libiso8601
-
 if [ -z ${isodate_BUILT} ]
 then
     isodate="obj/isodate"
-    EXTRAS="${libiso8601} ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS}"
+    EXTRAS="-std=gnu99 -D_GNU_SOURCE -DAPP_NAME=\"isodate\" \
+        ${libiso8601} ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS}"
 
     echo "Building application ${isodate}..."
 
@@ -39,5 +38,4 @@ then
 
 fi
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/isodate/build.install-app b/src/isodate/build.install-app
index b33660a..728fd40 100644
--- a/src/isodate/build.install-app
+++ b/src/isodate/build.install-app
@@ -8,5 +8,4 @@ echo "Installing binaries into '${BINDIR}'"
 install_file "${isodate}" "${BINDIR}" 0755 || return 1
 print_success "Done"
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/isodate/build.monolithic b/src/isodate/build.monolithic
index a4bfc00..5dce587 100644
--- a/src/isodate/build.monolithic
+++ b/src/isodate/build.monolithic
@@ -14,5 +14,4 @@ then
     MONOLITHIC_DOC="${MONOLITHIC_DOC} ${SRC}"
 fi
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/libiso8601/build.install-lib b/src/libiso8601/build.install-lib
index 3768c51..f3a9e35 100644
--- a/src/libiso8601/build.install-lib
+++ b/src/libiso8601/build.install-lib
@@ -34,5 +34,4 @@ do_cmd_redir "${CONFFILE}" sed \
 do_cmd chmod 0755 "${CONFFILE}"
 print_success "Done"
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/libiso8601/build.lib b/src/libiso8601/build.lib
index 3937758..aedcfef 100644
--- a/src/libiso8601/build.lib
+++ b/src/libiso8601/build.lib
@@ -14,7 +14,9 @@ then
     libiso8601="obj/${libiso8601_BASE}.so.${SOMAJOR}.${SOMICRO}"
     libiso8601_DEP_CFLAGS=""
     libiso8601_DEP_LIBS="-lrt"
-    SO_EXTRA="-std=gnu99 -D_GNU_SOURCE -DDEFAULT_LEAP_TABLE=\"${DEFAULT_LEAP_TABLE}\" ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} -lc"
+    SO_EXTRA="${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} -lc \
+        -D_GNU_SOURCE -std=gnu99 \
+        -DDEFAULT_LEAP_TABLE=\"${DEFAULT_LEAP_TABLE}\""
 
     echo "Building library ${libiso8601}..."
 
@@ -52,5 +54,4 @@ then
     libiso8601_HEADER=${HDR}
 
 fi
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/libiso8601/build.monolithic b/src/libiso8601/build.monolithic
index 4c8e7f8..4d8f158 100644
--- a/src/libiso8601/build.monolithic
+++ b/src/libiso8601/build.monolithic
@@ -17,5 +17,4 @@ then
     libiso8601_MONOLITHIC=1
     MONOLITHIC_DOC="${MONOLITHIC_DOC} ${HDR}"
 fi
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/libiso8601/config-script b/src/libiso8601/config-script
index 91ed2d4..3a81fae 100644
--- a/src/libiso8601/config-script
+++ b/src/libiso8601/config-script
@@ -95,4 +95,3 @@ true
 
 
 # vim: syntax=sh:expandtab:ts=4:sw=4
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion
index 06bbd00..058998c 100644
--- a/src/libiso8601/soversion
+++ b/src/libiso8601/soversion
@@ -1,8 +1,8 @@
 # libiso8601/src/libiso8601/soversion
 #
-#  (c)2007, Laurence Withers, .
-#  Released under the GNU GPLv3. See file COPYING or
-#  http://www.gnu.org/copyleft/gpl.html for details.
+#  Copyright: ©2007–2011, Güralp Systems Ltd.
+#  Author: Laurence Withers 
+#  License: GPLv3
 #
 
 
diff --git a/src/setisodate/build.app b/src/setisodate/build.app
index 7ba2cc1..77e4889 100644
--- a/src/setisodate/build.app
+++ b/src/setisodate/build.app
@@ -3,12 +3,11 @@
 #  setisodate_BUILT
 #
 
-build_target libiso8601
-
 if [ -z ${setisodate_BUILT} ]
 then
     setisodate="obj/setisodate"
-    EXTRAS="${libiso8601} ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS}"
+    EXTRAS="-std=gnu99 -D_GNU_SOURCE -DAPP_NAME=\"setisodate\" \
+        ${libiso8601} ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS}"
 
     echo "Building application ${setisodate}..."
 
@@ -39,5 +38,4 @@ then
 
 fi
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/setisodate/build.install-app b/src/setisodate/build.install-app
index 602f270..213198d 100644
--- a/src/setisodate/build.install-app
+++ b/src/setisodate/build.install-app
@@ -8,5 +8,4 @@ echo "Installing binaries into '${SBINDIR}'"
 install_file "${setisodate}" "${SBINDIR}" 0755 || return 1
 print_success "Done"
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/setisodate/build.monolithic b/src/setisodate/build.monolithic
index 11a2333..849b524 100644
--- a/src/setisodate/build.monolithic
+++ b/src/setisodate/build.monolithic
@@ -14,5 +14,4 @@ then
     MONOLITHIC_DOC="${MONOLITHIC_DOC} ${SRC}"
 fi
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/tests/build.default b/src/tests/build.default
index 1f0ae49..1ae62a2 100644
--- a/src/tests/build.default
+++ b/src/tests/build.default
@@ -1,3 +1 @@
 source src/tests/build.tests
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
-# vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/tests/build.tests b/src/tests/build.tests
index 2a31b3b..bfa8f8a 100644
--- a/src/tests/build.tests
+++ b/src/tests/build.tests
@@ -7,7 +7,7 @@ build_target libiso8601 || return 1
 if [ -z ${tests_BUILT} ]
 then
     LIBS="${libiso8601} ${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} "
-    EXTRAS="-D_GNU_SOURCE"
+    EXTRAS="-lm"
 
     echo "Building test programs..."
     do_cmd mkdir -p obj/tests || return 1
@@ -25,14 +25,9 @@ then
             fi
         done
 
-        case "${TEST}" in
-        obj/tests/manip) TEST_EXTRAS="-lm" ;;
-        *) TEST_EXTRAS="" ;;
-        esac
-
         if [ ${MODIFIED} -ne 0 ]
         then
-            do_cmd ${CC} -Iobj ${CFLAGS} -o ${TEST} ${SRC} ${LIBS} ${EXTRAS} ${TEST_EXTRAS} || return 1
+            do_cmd ${CC} -Iobj ${CFLAGS} -o ${TEST} ${SRC} ${LIBS} ${EXTRAS} || return 1
             print_success "Built ${TEST}"
         else
             print_success "${TEST} is up to date"
@@ -44,5 +39,4 @@ then
     tests_BUILT=1
 fi
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: syntax=sh:expandtab:ts=4:sw=4
diff --git a/src/tests/template b/src/tests/template
index 6d05ac7..82fc2bb 100644
--- a/src/tests/template
+++ b/src/tests/template
@@ -1,9 +1,9 @@
-/* libiso8601/src/tests/???.c
+/* libiso8601/src/tests/xxx.c
  *
- *  (c)2007, Laurence Withers, .
- *  Released under the GNU GPLv3. See file COPYING or
- *  http://www.gnu.org/copyleft/gpl.html for details.
-*/
+ *  Copyright: ©2007–2011, Güralp Systems Ltd.
+ *  Author: Laurence Withers 
+ *  License: GPLv3
+ */
 
 #include "iso8601.h"
 
@@ -12,7 +12,8 @@
 
 
 
-int main(int argc, char* argv[])
+int
+main(int argc, char* argv[])
 {
     int ret = 0;
 
@@ -30,7 +31,8 @@ int main(int argc, char* argv[])
     return ret;
 }
 
+
+
 /* options for text editors
-kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 vim: expandtab:ts=4:sw=4
 */
diff --git a/version b/version
index eabca08..4218b08 100644
--- a/version
+++ b/version
@@ -1,8 +1,8 @@
 # libiso8601/version
-#
-#  (c)2007, Laurence Withers, .
-#  Released under the GNU GPLv3. See file COPYING or
-#  http://www.gnu.org/copyleft/gpl.html for details.
+# 
+#  Copyright: ©2007–2011, Güralp Systems Ltd.
+#  Author: Laurence Withers 
+#  License: GPLv3
 #
 
 
@@ -13,5 +13,4 @@ VERMAJOR=0
 VERMINOR=3
 VERMICRO=11
 
-# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 # vim: expandtab:ts=4:sw=4:syntax=sh

From 81df4e8a05ec12a8140f220afbca5c62e7be2e4b Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Tue, 15 Nov 2011 16:49:22 +0000
Subject: [PATCH 25/37] Add C++ extern C include guards

---
 src/libiso8601/000_TopHeader.h    | 4 ++++
 src/libiso8601/999_BottomHeader.h | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/libiso8601/000_TopHeader.h b/src/libiso8601/000_TopHeader.h
index e8badd1..b22a556 100644
--- a/src/libiso8601/000_TopHeader.h
+++ b/src/libiso8601/000_TopHeader.h
@@ -8,6 +8,10 @@
 #ifndef HEADER_libiso8601
 #define HEADER_libiso8601
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* standard includes, or includes needed for type declarations */
 #include 
 #include 
diff --git a/src/libiso8601/999_BottomHeader.h b/src/libiso8601/999_BottomHeader.h
index 8a738c5..6923ccb 100644
--- a/src/libiso8601/999_BottomHeader.h
+++ b/src/libiso8601/999_BottomHeader.h
@@ -5,6 +5,10 @@
  *  http://www.gnu.org/copyleft/gpl.html for details.
 */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
 /* options for text editors

From b622223b64776b93b6ea54459fb966cc1275316d Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Wed, 16 Nov 2011 09:58:21 +0000
Subject: [PATCH 26/37] Remove unneeded nonnull attribute

---
 src/libiso8601/400_calc.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/libiso8601/400_calc.h b/src/libiso8601/400_calc.h
index 9570d8d..bf15b8d 100644
--- a/src/libiso8601/400_calc.h
+++ b/src/libiso8601/400_calc.h
@@ -26,11 +26,7 @@ understood by humans, and vice versa.
 Returns non-0 if \a year is a leap year.
 
 */
-int iso8601_isleap(int year)
-#ifndef DOXYGEN
-    __attribute__((nonnull))
-#endif
-;
+int iso8601_isleap(int year);
 
 
 

From c198eaf34b271e62edba39fe59c52e50dc1ed3e1 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Wed, 16 Nov 2011 12:04:15 +0000
Subject: [PATCH 27/37] Remove accidental variable definition

---
 src/libiso8601/100_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libiso8601/100_types.h b/src/libiso8601/100_types.h
index fa92a77..556c54b 100644
--- a/src/libiso8601/100_types.h
+++ b/src/libiso8601/100_types.h
@@ -58,7 +58,7 @@ enum iso8601_date_prec {
 
     /*! \brief Year, week and weekday specified (week format). */
     iso8601_prec_wday
-}date_prec;
+};
 
 
 
@@ -87,7 +87,7 @@ enum iso8601_time_prec {
     iso8601_prec_minfrac,
     /*! \brief Display hour, minute, second and nanoseconds. */
     iso8601_prec_secfrac
-}time_prec;
+};
 
 
 

From c7b38eab5a5c9631b6abe9b1cf9ffea39b9279c1 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 18 Nov 2011 12:19:09 +0000
Subject: [PATCH 28/37] Bump version

---
 src/libiso8601/soversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion
index 058998c..e3477cf 100644
--- a/src/libiso8601/soversion
+++ b/src/libiso8601/soversion
@@ -12,4 +12,4 @@
 SOMAJOR=1
 
 # SOMICRO is bumped every time there is a binary-compatible release.
-SOMICRO=8
+SOMICRO=9

From 49536349f74cfa6d62600823e5fd97ad7fa4136f Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 18 Nov 2011 12:19:09 +0000
Subject: [PATCH 29/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index 4218b08..37829a7 100644
--- a/version
+++ b/version
@@ -11,6 +11,6 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=11
+VERMICRO=12
 
 # vim: expandtab:ts=4:sw=4:syntax=sh

From ba81c458e1734c25b06c6ac8fe9ffc79ad9470a0 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Sat, 7 Jan 2012 17:42:44 +0000
Subject: [PATCH 30/37] Update for 2012-06-30 leap second

---
 src/libiso8601/100_leap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libiso8601/100_leap.c b/src/libiso8601/100_leap.c
index c57dd09..0331d05 100644
--- a/src/libiso8601/100_leap.c
+++ b/src/libiso8601/100_leap.c
@@ -39,6 +39,7 @@ leap_second_days_table[] = {
     730119, /* 1998-12-31 */
     732676, /* 2005-12-31 */
     733772, /* 2008-12-31 */
+    735049, /* 2012-06-30 */
 };
 
 

From 4c470ec1e9f061e89e60905069a1aa1f48068f91 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Sat, 7 Jan 2012 17:42:57 +0000
Subject: [PATCH 31/37] Bump version

---
 src/libiso8601/soversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libiso8601/soversion b/src/libiso8601/soversion
index e3477cf..9bc2def 100644
--- a/src/libiso8601/soversion
+++ b/src/libiso8601/soversion
@@ -12,4 +12,4 @@
 SOMAJOR=1
 
 # SOMICRO is bumped every time there is a binary-compatible release.
-SOMICRO=9
+SOMICRO=10

From dcb15f20818882d6bbe322414b037d74b0f3d17d Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Sat, 7 Jan 2012 17:42:57 +0000
Subject: [PATCH 32/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index 37829a7..07c3af8 100644
--- a/version
+++ b/version
@@ -11,6 +11,6 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=12
+VERMICRO=13
 
 # vim: expandtab:ts=4:sw=4:syntax=sh

From 6b25293f359e4d0c3fbe14b089cb68d9ff56b6c3 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 5 Apr 2013 09:32:22 +0000
Subject: [PATCH 33/37] Fix build system ordering

Make sure that the library is built before either of the isodate or setisodate
apps, otherwise we end up with problems compiling from scratch.
---
 src/isodate/build.app    | 2 ++
 src/setisodate/build.app | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/isodate/build.app b/src/isodate/build.app
index b4eb742..3e4223b 100644
--- a/src/isodate/build.app
+++ b/src/isodate/build.app
@@ -3,6 +3,8 @@
 #  isodate_BUILT
 #
 
+build_target libiso8601
+
 if [ -z ${isodate_BUILT} ]
 then
     isodate="obj/isodate"
diff --git a/src/setisodate/build.app b/src/setisodate/build.app
index 77e4889..af8d0f8 100644
--- a/src/setisodate/build.app
+++ b/src/setisodate/build.app
@@ -3,6 +3,8 @@
 #  setisodate_BUILT
 #
 
+build_target libiso8601
+
 if [ -z ${setisodate_BUILT} ]
 then
     setisodate="obj/setisodate"

From 0d5c2078b394dad0e20a54fbbadd84fdaf939456 Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 5 Apr 2013 09:35:19 +0000
Subject: [PATCH 34/37] Bump version

---
 version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version b/version
index 07c3af8..d1c7763 100644
--- a/version
+++ b/version
@@ -11,6 +11,6 @@
 # expected to be in 'major.minor.micro' format.
 VERMAJOR=0
 VERMINOR=3
-VERMICRO=13
+VERMICRO=14
 
 # vim: expandtab:ts=4:sw=4:syntax=sh

From dd3fe182afc00005dd05dafdcc0ae00f224eafeb Mon Sep 17 00:00:00 2001
From: Laurence Withers 
Date: Fri, 12 Jun 2015 10:53:31 +0100
Subject: [PATCH 35/37] Update build system (Doxyfile)

---
 src/docs/Doxyfile.in | 2385 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 2268 insertions(+), 117 deletions(-)

diff --git a/src/docs/Doxyfile.in b/src/docs/Doxyfile.in
index 5952cb7..2b65442 100644
--- a/src/docs/Doxyfile.in
+++ b/src/docs/Doxyfile.in
@@ -1,207 +1,2358 @@
 # libiso8601/src/docs/Doxyfile.in
 #
-#  (c)2007, Laurence Withers, .
-#  Released under the GNU GPLv3. See file COPYING or
-#  http://www.gnu.org/copyleft/gpl.html for details.
+#  Copyright: ©2015, Laurence Withers
+#  Author: Laurence Withers 
+#  License: GPLv3
 #
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
 
 DOXYFILE_ENCODING      = UTF-8
-PROJECT_NAME           = libiso8601
-OUTPUT_DIRECTORY       = 
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME           = "libiso8601"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+# This will be added by lw-build-system
+# PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
 CREATE_SUBDIRS         = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES    = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
 OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
 BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
 REPEAT_BRIEF           = YES
-ABBREVIATE_BRIEF       = 
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
 ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
 INLINE_INHERITED_MEMB  = YES
+
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
 FULL_PATH_NAMES        = NO
-STRIP_FROM_PATH        = 
-STRIP_FROM_INC_PATH    = 
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
 SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
 JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
 QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
 MULTILINE_CPP_IS_BRIEF = YES
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
 INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
+
 SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
 TAB_SIZE               = 4
-ALIASES                = 
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
 OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
 OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
 OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
 OPTIMIZE_OUTPUT_VHDL   = NO
-BUILTIN_STL_SUPPORT    = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT    = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
 CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
 SIP_SUPPORT            = NO
-IDL_PROPERTY_SUPPORT   = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
 DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
 SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS  = YES
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
 TYPEDEF_HIDES_STRUCT   = NO
-SYMBOL_CACHE_SIZE      = 0
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE      = 2
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
 EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
 EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
 EXTRACT_STATIC         = NO
-EXTRACT_LOCAL_CLASSES  = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
+
 EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
 EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
 HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
 HIDE_UNDOC_CLASSES     = NO
-HIDE_FRIEND_COMPOUNDS  = YES
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
 HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
 INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
 CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
+
 HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
 SHOW_INCLUDE_FILES     = NO
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC  = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
 INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
+
 SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
 SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
 SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
 SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
+
 GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
+
 GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
 GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
 GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS       = 
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if  ... \endif and \cond 
+# ... \endcond blocks.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
 MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
 SHOW_USED_FILES        = NO
-SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
 SHOW_FILES             = NO
-SHOW_NAMESPACES        = YES
-FILE_VERSION_FILTER    = 
-LAYOUT_FILE            = 
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES        = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
 QUIET                  = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
 WARNINGS               = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
 WARN_IF_UNDOCUMENTED   = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
 WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
+
 WARN_NO_PARAMDOC       = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
 WARN_FORMAT            = "$file:$line: $text"
-WARN_LOGFILE           = 
-INPUT                  = 
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+# this will be added by lw-build-system
+# INPUT                  =
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
 INPUT_ENCODING         = UTF-8
-FILE_PATTERNS          = 
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
 RECURSIVE              = NO
-EXCLUDE                = 
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
 EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXCLUDE_SYMBOLS        = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
 EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
 IMAGE_PATH             = src/docs
-INPUT_FILTER           = 
-FILTER_PATTERNS        = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+#  
+#
+# where  is the value of the INPUT_FILTER tag, and  is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
 FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
 SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
 INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
 STRIP_CODE_COMMENTS    = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
 REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS        = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
 USE_HTAGS              = NO
-VERBATIM_HEADERS       = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS       = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# compiled with the --with-libclang option.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS          =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
 ALPHABETICAL_INDEX     = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
 COLS_IN_ALPHA_INDEX    = 5
-IGNORE_PREFIX          = 
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
+
 GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = 
-HTML_FOOTER            = 
-HTML_STYLESHEET        = 
-HTML_ALIGN_MEMBERS     = YES
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra stylesheet files is of importance (e.g. the last
+# stylesheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET  =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 HTML_DYNAMIC_SECTIONS  = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 GENERATE_DOCSET        = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
 DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
 DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 GENERATE_HTMLHELP      = NO
-CHM_FILE               = 
-HHC_LOCATION           = 
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE               =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION           =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
 GENERATE_CHI           = NO
-CHM_INDEX_ENCODING     = 
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING     =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
 BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
 TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 GENERATE_QHP           = NO
-QCH_FILE               = 
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
 QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
 QHP_VIRTUAL_FOLDER     = doc
-QHG_LOCATION           = 
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 GENERATE_TREEVIEW      = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
 FORMULA_FONTSIZE       = 10
-GENERATE_LATEX         = NO
-LATEX_OUTPUT           = latex
-LATEX_CMD_NAME         = latex
-MAKEINDEX_CMD_NAME     = makeindex
-COMPACT_LATEX          = NO
-PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
-PDF_HYPERLINKS         = NO
-USE_PDFLATEX           = NO
-LATEX_BATCHMODE        = NO
-LATEX_HIDE_INDICES     = NO
-GENERATE_RTF           = NO
-RTF_OUTPUT             = rtf
-COMPACT_RTF            = NO
-RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
-GENERATE_MAN           = NO
-MAN_OUTPUT             = man
-MAN_EXTENSION          = .3
-MAN_LINKS              = NO
-GENERATE_XML           = NO
-XML_OUTPUT             = xml
-XML_SCHEMA             = 
-XML_DTD                = 
-XML_PROGRAMLISTING     = YES
-GENERATE_AUTOGEN_DEF   = NO
-GENERATE_PERLMOD       = NO
-PERLMOD_LATEX          = NO
-PERLMOD_PRETTY         = YES
-PERLMOD_MAKEVAR_PREFIX = 
-ENABLE_PREPROCESSING   = YES
-MACRO_EXPANSION        = YES
-EXPAND_ONLY_PREDEF     = YES
-SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = DOXYGEN \
-                         __attribute__()=
-EXPAND_AS_DEFINED      = 
-SKIP_FUNCTION_MACROS   = YES
-TAGFILES               = 
-GENERATE_TAGFILE       = 
-ALLEXTERNALS           = NO
-EXTERNAL_GROUPS        = YES
-PERL_PATH              = /usr/bin/perl
-CLASS_DIAGRAMS         = YES
-MSCGEN_PATH            = 
-HIDE_UNDOC_RELATIONS   = YES
-HAVE_DOT               = YES
-DOT_FONTNAME           = FreeSans
-DOT_FONTSIZE           = 10
-DOT_FONTPATH           = 
-CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = YES
-GROUP_GRAPHS           = NO
-UML_LOOK               = NO
-TEMPLATE_RELATIONS     = NO
-INCLUDE_GRAPH          = NO
-INCLUDED_BY_GRAPH      = NO
-CALL_GRAPH             = NO
-CALLER_GRAPH           = NO
-GRAPHICAL_HIERARCHY    = YES
-DIRECTORY_GRAPH        = NO
-DOT_IMAGE_FORMAT       = png
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-DOT_GRAPH_MAX_NODES    = 50
-MAX_DOT_GRAPH_DEPTH    = 0
-DOT_TRANSPARENT        = YES
-DOT_MULTI_TARGETS      = YES
-GENERATE_LEGEND        = YES
-DOT_CLEANUP            = YES
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS     =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE       =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use  + S
+# (what the  is depends on the OS and browser, but it is typically
+# , /