Compare commits
24 Commits
Author | SHA1 | Date |
---|---|---|
|
82aa0f2f20 | |
|
2e610c4db3 | |
|
dd3fe182af | |
![]() |
0d5c2078b3 | |
![]() |
6b25293f35 | |
|
dcb15f2081 | |
|
4c470ec1e9 | |
|
ba81c458e1 | |
![]() |
49536349f7 | |
![]() |
c7b38eab5a | |
![]() |
c198eaf34b | |
![]() |
b622223b64 | |
![]() |
81df4e8a05 | |
![]() |
7a5f30bfcd | |
![]() |
d910e88bc3 | |
![]() |
2aa3d5aaac | |
![]() |
d013bff263 | |
![]() |
8cc71fb069 | |
![]() |
2d9621e0a5 | |
![]() |
944331702f | |
![]() |
0d56edd890 | |
![]() |
65fe613272 | |
![]() |
64e06d17c4 | |
![]() |
cd9a2d252a |
1
make.sh
1
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
|
||||
|
|
14
run-test.sh
14
run-test.sh
|
@ -1,9 +1,9 @@
|
|||
#!/bin/bash
|
||||
# libiso8601/test.sh
|
||||
#
|
||||
# (c)2009, Laurence Withers, <l@lwithers.me.uk>.
|
||||
# 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 <lwithers@guralp.com>
|
||||
# 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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# libiso8601/scripts/functions.sh
|
||||
#
|
||||
# (c)2007, Laurence Withers, <l@lwithers.me.uk>.
|
||||
# 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, <lwithers@guralp.com>
|
||||
# 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
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# libiso8601/scripts/paths
|
||||
#
|
||||
# (c)2007, Laurence Withers, <l@lwithers.me.uk>.
|
||||
# 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, <lwithers@guralp.com>
|
||||
# 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
|
||||
|
|
2333
src/docs/Doxyfile.in
2333
src/docs/Doxyfile.in
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,7 +8,8 @@ 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 +40,4 @@ then
|
|||
|
||||
fi
|
||||
|
||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
#ifndef HEADER_libiso8601
|
||||
#define HEADER_libiso8601
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* standard includes, or includes needed for type declarations */
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
|
|
|
@ -39,6 +39,8 @@ leap_second_days_table[] = {
|
|||
730119, /* 1998-12-31 */
|
||||
732676, /* 2005-12-31 */
|
||||
733772, /* 2008-12-31 */
|
||||
735049, /* 2012-06-30 */
|
||||
736144, /* 2015-06-30 */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
;
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
* http://www.gnu.org/copyleft/gpl.html for details.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* options for text editors
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# libiso8601/src/libiso8601/soversion
|
||||
#
|
||||
# (c)2007, Laurence Withers, <l@lwithers.me.uk>.
|
||||
# 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 <lwithers@guralp.com>
|
||||
# License: GPLv3
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,4 +12,4 @@
|
|||
SOMAJOR=1
|
||||
|
||||
# SOMICRO is bumped every time there is a binary-compatible release.
|
||||
SOMICRO=5
|
||||
SOMICRO=10
|
||||
|
|
|
@ -8,7 +8,8 @@ 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 +40,4 @@ then
|
|||
|
||||
fi
|
||||
|
||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* libiso8601/src/tests/???.c
|
||||
/* libiso8601/src/tests/xxx.c
|
||||
*
|
||||
* (c)2007, Laurence Withers, <l@lwithers.me.uk>.
|
||||
* 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 <lwithers@guralp.com>
|
||||
* 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
|
||||
*/
|
||||
|
|
9
version
9
version
|
@ -1,8 +1,8 @@
|
|||
# libiso8601/version
|
||||
#
|
||||
# (c)2007, Laurence Withers, <l@lwithers.me.uk>.
|
||||
# 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 <lwithers@guralp.com>
|
||||
# License: GPLv3
|
||||
#
|
||||
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
|||
# expected to be in 'major.minor.micro' format.
|
||||
VERMAJOR=0
|
||||
VERMINOR=3
|
||||
VERMICRO=8
|
||||
VERMICRO=15
|
||||
|
||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||
# vim: expandtab:ts=4:sw=4:syntax=sh
|
||||
|
|
Loading…
Reference in New Issue