summaryrefslogtreecommitdiff
path: root/src/libstddjb/leapsecs_init.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-10-14 22:54:08 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-10-14 22:54:08 +0000
commit805729e206b7586c57483aa0f4a90f7e0e2c9661 (patch)
tree4d4afb75b73cd11c953853faa48dc4cc7f236380 /src/libstddjb/leapsecs_init.c
parent2e0421fc58922697f2bb51c428599fbd44055556 (diff)
downloadskalibs-2.3.8.0.tar.xz
- Remove /etc/leapsecs.datv2.3.8.0
- Publish tools to create the leap second table as a .c - Simplify functions using leap seconds - rc for 2.3.8.0
Diffstat (limited to 'src/libstddjb/leapsecs_init.c')
-rw-r--r--src/libstddjb/leapsecs_init.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/libstddjb/leapsecs_init.c b/src/libstddjb/leapsecs_init.c
deleted file mode 100644
index 41f9b89..0000000
--- a/src/libstddjb/leapsecs_init.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ISC license. */
-
-#include <errno.h>
-#include <skalibs/uint64.h>
-#include <skalibs/djbunix.h>
-#include "djbtime-internal.h"
-
-static unsigned int leapsecs_len (uint64 const *data)
-{
- register unsigned int i = 1 ;
- while (data[i]) i++ ;
- return i ;
-}
-
-static int leapsecs_read (char const *file, uint64 *data)
-{
- char s[LEAPSECS_MAX * sizeof(uint64)] ;
- register int n = openreadnclose(file, s, LEAPSECS_MAX * sizeof(uint64)) ;
- if (n < 0) return -1 ;
- if (n % sizeof(uint64)) return (errno = EINVAL, -1) ;
- n /= sizeof(uint64) ;
- {
- register unsigned int i = 0 ;
- for (; i < (unsigned int)n ; i++)
- uint64_unpack_big(s + i * sizeof(uint64), data + i) ;
- }
- data[n] = 0 ;
- return n ;
-}
-
-int leapsecs_init_r (char const *file, uint64 *data)
-{
- return data[0] ? (int)leapsecs_len(data) : leapsecs_read(file, data) ;
-}