From: Ralph Corderoy Date: Sun, 12 Nov 2017 18:40:21 +0000 (+0000) Subject: dtime.c: Move interface to own file. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/4fc4c15e6b9c39af3bf5367efeb2412c1267169a dtime.c: Move interface to own file. --- diff --git a/Makefile.am b/Makefile.am index 42e75a5f..fbce3f5e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -382,6 +382,7 @@ noinst_HEADERS = \ sbr/credentials.h \ sbr/ctype-checked.h \ sbr/discard.h \ + sbr/dtime.h \ sbr/encode_rfc2047.h \ sbr/error.h \ sbr/escape_addresses.h \ diff --git a/h/tws.h b/h/tws.h index 17a01a2d..495343f8 100644 --- a/h/tws.h +++ b/h/tws.h @@ -36,23 +36,7 @@ struct tws { #define dtwszone(tw) dtimezone (tw->tw_zone, tw->tw_flags) -extern char *tw_dotw[]; -extern char *tw_ldotw[]; -extern char *tw_moty[]; - /* * prototypes */ -char *dtime (time_t *, int); -char *dtimenow (int); -char *dctime (struct tws *); -struct tws *dlocaltimenow (void); -struct tws *dlocaltime (time_t *); -struct tws *dgmtime (time_t *); -char *dasctime (struct tws *, int); -char *dtimezone (int, int); -int twsort (struct tws *, struct tws *); -time_t dmktime (struct tws *); -void set_dotw (struct tws *); - struct tws *dparsetime (char *); diff --git a/sbr/datetime.c b/sbr/datetime.c index e4d2d148..71a21f99 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "dtime.h" #include "error.h" #include "h/icalendar.h" #include "h/fmt_scan.h" diff --git a/sbr/dtime.c b/sbr/dtime.c index 3f8f7631..a8b8432c 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "dtime.h" #include "h/nmh.h" #include "h/utils.h" #include "h/tws.h" diff --git a/sbr/dtime.h b/sbr/dtime.h new file mode 100644 index 00000000..8accd9ec --- /dev/null +++ b/sbr/dtime.h @@ -0,0 +1,21 @@ +/* dtime.h -- time/date routines + * + * This code is Copyright (c) 2017, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ + +extern char *tw_moty[]; +extern char *tw_dotw[]; +extern char *tw_ldotw[]; + +struct tws *dlocaltimenow(void); +struct tws *dlocaltime(time_t *); +struct tws *dgmtime(time_t *); +char *dctime(struct tws *); +char *dtimenow(int); +char *dtime(time_t *, int); +char *dasctime(struct tws *, int); +char *dtimezone(int, int); +time_t dmktime(struct tws *); +void set_dotw(struct tws *); +int twsort(struct tws *, struct tws *); diff --git a/sbr/dtimep.l b/sbr/dtimep.l index 68f0ea7b..699e90e4 100644 --- a/sbr/dtimep.l +++ b/sbr/dtimep.l @@ -12,6 +12,7 @@ %{ #include "h/nmh.h" #include "h/mh.h" +#include "dtime.h" #include "h/utils.h" #include "h/tws.h" diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index c5dc4f75..869a278e 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -9,6 +9,7 @@ */ #include "h/mh.h" +#include "dtime.h" #include "strindex.h" #include "fmt_rfc2047.h" #include "uprf.h" diff --git a/uip/annosbr.c b/uip/annosbr.c index e9b64dc7..fcb5e095 100644 --- a/uip/annosbr.c +++ b/uip/annosbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "annosbr.h" #include "sbr/m_gmprot.h" #include "sbr/cpydata.h" diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 733e6e6e..0029f074 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -7,6 +7,7 @@ #include "h/nmh.h" #include "h/mh.h" +#include "sbr/dtime.h" #include "sbr/strindex.h" #include "sbr/error.h" #include "h/utils.h" diff --git a/uip/forwsbr.c b/uip/forwsbr.c index 07ea3aeb..005bc9ca 100644 --- a/uip/forwsbr.c +++ b/uip/forwsbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "sbr/m_getfld.h" #include "sbr/getcpy.h" #include "sbr/error.h" diff --git a/uip/inc.c b/uip/inc.c index 70dddbd5..bceea53f 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -31,6 +31,7 @@ #endif #include "h/mh.h" +#include "sbr/dtime.h" #include "scansbr.h" #include "sbr/m_name.h" #include "sbr/m_gmprot.h" diff --git a/uip/msgchk.c b/uip/msgchk.c index 411686e4..24dc25f3 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" diff --git a/uip/picksbr.c b/uip/picksbr.c index bee22f2c..a2a8a79f 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -6,6 +6,8 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" +#include "sbr/dtime.h" #include "sbr/m_getfld.h" #include "sbr/smatch.h" #include "sbr/fmt_rfc2047.h" diff --git a/uip/post.c b/uip/post.c index 1dd794df..09c66151 100644 --- a/uip/post.c +++ b/uip/post.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "sbr/m_getfld.h" #include "sbr/getarguments.h" #include "sbr/concat.h" diff --git a/uip/scan.c b/uip/scan.c index b74b3607..8a2e8dc0 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "scansbr.h" #include "sbr/m_name.h" #include "sbr/getarguments.h" diff --git a/uip/scansbr.c b/uip/scansbr.c index 81abc7d4..38b2ca41 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "scansbr.h" #include "sbr/m_name.h" #include "sbr/m_gmprot.h" diff --git a/uip/slocal.c b/uip/slocal.c index 66685b44..f0f8dc5e 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -20,6 +20,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "sbr/m_gmprot.h" #include "sbr/m_getfld.h" #include "sbr/getarguments.h" diff --git a/uip/sortm.c b/uip/sortm.c index e2b6185c..347ea17c 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" #include "sbr/m_name.h" #include "sbr/m_getfld.h" #include "sbr/getarguments.h"