# HG changeset patch # User uh1763 # Date 957911318 -3600 # Node ID 125d79c9e58652c190fce138d02c20faacd389d6 # Parent 9f3a4eccce325af1f52821ceafa990522a0617eb [svn] * src/client.c, src/configfile.c, src/content.c, src/control.c, src/database.c, src/dynamicstring.c, src/fetch.c, src/fetchlist.c, src/group.c, src/itemlist.c, src/lock.c, src/log.c, src/noffle.c, src/online.c, src/outgoing.c, src/over.c, src/post.c, src/protocol.c, src/pseudo.c, src/request.c, src/server.c, src/util.c: Added portable.h #include. * src/client.h, src/database.h, src/fetch.c, src/group.h, src/lock.c, src/outgoing.c, src/over.c, src/over.h, src/pseudo.c, src/server.c, src/util.c, src/util.h: Added some #ifdefs to correctly include either time.h or sys/time.h or both, depending on which are found. * src/noffle.c: Changed the return-type of the signal-handlers bugReport() and logSignal() to RETSIGTYPE, which is either void or int, depending on the system you compile on (autoconf #defines the RETSIGTYPE). diff -r 9f3a4eccce32 -r 125d79c9e586 ChangeLog --- a/ChangeLog Mon May 08 17:52:14 2000 +0100 +++ b/ChangeLog Tue May 09 23:28:38 2000 +0100 @@ -2,6 +2,24 @@ NOFFLE ChangeLog ------------------------------------------------------------------------------- +Wed May 10 00:25:44 CEST 2000 Uwe Hermann + + * src/client.c, src/configfile.c, src/content.c, src/control.c, + src/database.c, src/dynamicstring.c, src/fetch.c, src/fetchlist.c, + src/group.c, src/itemlist.c, src/lock.c, src/log.c, src/noffle.c, + src/online.c, src/outgoing.c, src/over.c, src/post.c, src/protocol.c, + src/pseudo.c, src/request.c, src/server.c, src/util.c: + Added portable.h #include. + + * src/client.h, src/database.h, src/fetch.c, src/group.h, src/lock.c, + src/outgoing.c, src/over.c, src/over.h, src/pseudo.c, src/server.c, + src/util.c, src/util.h: Added some #ifdefs to correctly include either + time.h or sys/time.h or both, depending on which are found. + + * src/noffle.c: Changed the return-type of the signal-handlers bugReport() + and logSignal() to RETSIGTYPE, which is either void or int, depending on + the system you compile on (autoconf #defines the RETSIGTYPE). + Sat May 6 12:25:39 BST 2000 Jim Hague diff -r 9f3a4eccce32 -r 125d79c9e586 src/client.c --- a/src/client.c Mon May 08 17:52:14 2000 +0100 +++ b/src/client.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* client.c - $Id: client.c 54 2000-05-06 16:55:22Z bears $ + $Id: client.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -30,6 +30,7 @@ #include "request.h" #include "util.h" #include "wildmat.h" +#include "portable.h" /* Some newsgroups names are reserved for server-specific or server diff -r 9f3a4eccce32 -r 125d79c9e586 src/client.h --- a/src/client.h Mon May 08 17:52:14 2000 +0100 +++ b/src/client.h Tue May 09 23:28:38 2000 +0100 @@ -3,7 +3,7 @@ Noffle acting as client to other NNTP-servers - $Id: client.h 51 2000-05-05 23:49:38Z uh1763 $ + $Id: client.h 60 2000-05-09 22:28:38Z uh1763 $ */ #ifndef CLIENT_H @@ -13,7 +13,17 @@ #include #endif +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "common.h" #include "database.h" #include "fetchlist.h" diff -r 9f3a4eccce32 -r 125d79c9e586 src/configfile.c --- a/src/configfile.c Mon May 08 17:52:14 2000 +0100 +++ b/src/configfile.c Tue May 09 23:28:38 2000 +0100 @@ -6,7 +6,7 @@ SPOOLDIR VERSION - $Id: configfile.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: configfile.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -18,6 +18,7 @@ #include #include "log.h" #include "util.h" +#include "portable.h" typedef struct { diff -r 9f3a4eccce32 -r 125d79c9e586 src/content.c --- a/src/content.c Mon May 08 17:52:14 2000 +0100 +++ b/src/content.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* content.c - $Id: content.c 55 2000-05-06 16:56:50Z bears $ + $Id: content.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -22,6 +22,7 @@ #include "pseudo.h" #include "util.h" #include "content.h" +#include "portable.h" struct { diff -r 9f3a4eccce32 -r 125d79c9e586 src/control.c --- a/src/control.c Mon May 08 17:52:14 2000 +0100 +++ b/src/control.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* control.c - $Id: control.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: control.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -17,6 +17,7 @@ #include "itemlist.h" #include "log.h" #include "outgoing.h" +#include "portable.h" int Ctrl_cancel( const char *msgId ) diff -r 9f3a4eccce32 -r 125d79c9e586 src/database.c --- a/src/database.c Mon May 08 17:52:14 2000 +0100 +++ b/src/database.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* database.c - $Id: database.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: database.c 60 2000-05-09 22:28:38Z uh1763 $ Uses GNU gdbm library. Using Berkeley db (included in libc6) was cumbersome. It is based on Berkeley db 1.85, which has severe bugs @@ -28,6 +28,7 @@ #include "protocol.h" #include "util.h" #include "wildmat.h" +#include "portable.h" static struct Db { diff -r 9f3a4eccce32 -r 125d79c9e586 src/database.h --- a/src/database.h Mon May 08 17:52:14 2000 +0100 +++ b/src/database.h Tue May 09 23:28:38 2000 +0100 @@ -3,7 +3,7 @@ Article database. - $Id: database.h 51 2000-05-05 23:49:38Z uh1763 $ + $Id: database.h 60 2000-05-09 22:28:38Z uh1763 $ */ #ifndef DB_H @@ -13,7 +13,17 @@ #include #endif +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "common.h" #include "dynamicstring.h" #include "over.h" diff -r 9f3a4eccce32 -r 125d79c9e586 src/dynamicstring.c --- a/src/dynamicstring.c Mon May 08 17:52:14 2000 +0100 +++ b/src/dynamicstring.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* dynamicstring.c - $Id: dynamicstring.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: dynamicstring.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -12,6 +12,7 @@ #include #include "log.h" +#include "portable.h" struct DynStr { diff -r 9f3a4eccce32 -r 125d79c9e586 src/fetch.c --- a/src/fetch.c Mon May 08 17:52:14 2000 +0100 +++ b/src/fetch.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* fetch.c - $Id: fetch.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: fetch.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -11,7 +11,18 @@ #include #include "fetch.h" #include + +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include #include "client.h" #include "configfile.h" @@ -25,6 +36,7 @@ #include "protocol.h" #include "pseudo.h" #include "util.h" +#include "portable.h" struct Fetch { diff -r 9f3a4eccce32 -r 125d79c9e586 src/fetchlist.c --- a/src/fetchlist.c Mon May 08 17:52:14 2000 +0100 +++ b/src/fetchlist.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* fetchlist.c - $Id: fetchlist.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: fetchlist.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -13,6 +13,7 @@ #include "configfile.h" #include "log.h" #include "util.h" +#include "portable.h" struct Elem { diff -r 9f3a4eccce32 -r 125d79c9e586 src/group.c --- a/src/group.c Mon May 08 17:52:14 2000 +0100 +++ b/src/group.c Tue May 09 23:28:38 2000 +0100 @@ -7,7 +7,7 @@ loadGrp() and saveGrp(). This is done transparently. Access to the groups database is done by group name, by the functions defined in group.h. - $Id: group.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: group.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -23,6 +23,7 @@ #include "configfile.h" #include "log.h" #include "util.h" +#include "portable.h" /* currently only used within grp */ typedef struct diff -r 9f3a4eccce32 -r 125d79c9e586 src/group.h --- a/src/group.h Mon May 08 17:52:14 2000 +0100 +++ b/src/group.h Tue May 09 23:28:38 2000 +0100 @@ -3,7 +3,7 @@ Groups database - $Id: group.h 51 2000-05-05 23:49:38Z uh1763 $ + $Id: group.h 60 2000-05-09 22:28:38Z uh1763 $ */ #ifndef GRP_H @@ -13,7 +13,17 @@ #include #endif +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "common.h" #define GRP_LOCAL_SERVER_NAME "(local)" diff -r 9f3a4eccce32 -r 125d79c9e586 src/itemlist.c --- a/src/itemlist.c Mon May 08 17:52:14 2000 +0100 +++ b/src/itemlist.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* itemlist.c - $Id: itemlist.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: itemlist.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -14,6 +14,7 @@ #include #include "common.h" #include "log.h" +#include "portable.h" struct ItemList { diff -r 9f3a4eccce32 -r 125d79c9e586 src/lock.c --- a/src/lock.c Mon May 08 17:52:14 2000 +0100 +++ b/src/lock.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* lock.c - $Id: lock.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: lock.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -15,13 +15,25 @@ #include #include #include + +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include #include "configfile.h" #include "log.h" #include "database.h" #include "group.h" #include "request.h" +#include "portable.h" struct Lock { diff -r 9f3a4eccce32 -r 125d79c9e586 src/log.c --- a/src/log.c Mon May 08 17:52:14 2000 +0100 +++ b/src/log.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* log.c - $Id: log.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: log.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -12,6 +12,7 @@ #include #include "common.h" #include "log.h" +#include "portable.h" #define MAXLENGTH 240 diff -r 9f3a4eccce32 -r 125d79c9e586 src/noffle.c --- a/src/noffle.c Mon May 08 17:52:14 2000 +0100 +++ b/src/noffle.c Tue May 09 23:28:38 2000 +0100 @@ -10,7 +10,7 @@ received for some seconds (to allow multiple clients connect at the same time). - $Id: noffle.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: noffle.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -43,6 +43,7 @@ #include "server.h" #include "request.h" #include "lock.h" +#include "portable.h" struct Noffle @@ -561,7 +562,7 @@ Lock_closeDatabases(); } -static void +static RETSIGTYPE bugReport( int sig ) { Log_err( "Received SIGSEGV. Please submit a bug report" ); @@ -569,7 +570,7 @@ raise( sig ); } -static void +static RETSIGTYPE logSignal( int sig ) { const char *name; diff -r 9f3a4eccce32 -r 125d79c9e586 src/online.c --- a/src/online.c Mon May 08 17:52:14 2000 +0100 +++ b/src/online.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* online.c - $Id: online.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: online.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -14,6 +14,7 @@ #include "configfile.h" #include "log.h" #include "online.h" +#include "portable.h" static void fileOnline( Str s ) diff -r 9f3a4eccce32 -r 125d79c9e586 src/outgoing.c --- a/src/outgoing.c Mon May 08 17:52:14 2000 +0100 +++ b/src/outgoing.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* outgoing.c - $Id: outgoing.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: outgoing.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -16,11 +16,23 @@ #include #include #include + +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include #include "configfile.h" #include "log.h" #include "util.h" +#include "portable.h" struct Outgoing { diff -r 9f3a4eccce32 -r 125d79c9e586 src/over.c --- a/src/over.c Mon May 08 17:52:14 2000 +0100 +++ b/src/over.c Tue May 09 23:28:38 2000 +0100 @@ -1,15 +1,25 @@ /* over.c - $Id: over.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: over.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H #include #endif +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include -#include #include "configfile.h" #include "content.h" #include "database.h" @@ -18,6 +28,7 @@ #include "util.h" #include "protocol.h" #include "pseudo.h" +#include "portable.h" struct Over { diff -r 9f3a4eccce32 -r 125d79c9e586 src/over.h --- a/src/over.h Mon May 08 17:52:14 2000 +0100 +++ b/src/over.h Tue May 09 23:28:38 2000 +0100 @@ -5,7 +5,7 @@ content.c. An article overview contains important article properties, such as date, from, subject. - $Id: over.h 51 2000-05-05 23:49:38Z uh1763 $ + $Id: over.h 60 2000-05-09 22:28:38Z uh1763 $ */ #ifndef OVER_H @@ -15,7 +15,17 @@ #include #endif +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "common.h" struct Over; diff -r 9f3a4eccce32 -r 125d79c9e586 src/post.c --- a/src/post.c Mon May 08 17:52:14 2000 +0100 +++ b/src/post.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* post.c - $Id: post.c 49 2000-05-05 21:45:56Z uh1763 $ + $Id: post.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -19,6 +19,7 @@ #include "over.h" #include "protocol.h" #include "util.h" +#include "portable.h" struct OverInfo { diff -r 9f3a4eccce32 -r 125d79c9e586 src/protocol.c --- a/src/protocol.c Mon May 08 17:52:14 2000 +0100 +++ b/src/protocol.c Tue May 09 23:28:38 2000 +0100 @@ -1,7 +1,7 @@ /* protocol.c - $Id: protocol.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: protocol.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -19,6 +19,7 @@ #include "over.h" #include "util.h" #include "protocol.h" +#include "portable.h" Bool Prt_getLn( Str line, FILE *f ) diff -r 9f3a4eccce32 -r 125d79c9e586 src/pseudo.c --- a/src/pseudo.c Mon May 08 17:52:14 2000 +0100 +++ b/src/pseudo.c Tue May 09 23:28:38 2000 +0100 @@ -1,17 +1,27 @@ /* pseudo.c - $Id: pseudo.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: pseudo.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H #include #endif +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "pseudo.h" #include -#include #include "common.h" #include "configfile.h" #include "content.h" @@ -21,6 +31,7 @@ #include "protocol.h" #include "util.h" #include "pseudo.h" +#include "portable.h" static Over * genOv( const char *rawSubj, const char *rawBody, const char *suffix ) diff -r 9f3a4eccce32 -r 125d79c9e586 src/request.c --- a/src/request.c Mon May 08 17:52:14 2000 +0100 +++ b/src/request.c Tue May 09 23:28:38 2000 +0100 @@ -3,7 +3,7 @@ Collection of articles that are marked for download. - $Id: request.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: request.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H @@ -22,6 +22,7 @@ #include "configfile.h" #include "log.h" #include "util.h" +#include "portable.h" /* This struct keeps record of the message IDs that are to be fetched from diff -r 9f3a4eccce32 -r 125d79c9e586 src/server.c --- a/src/server.c Mon May 08 17:52:14 2000 +0100 +++ b/src/server.c Tue May 09 23:28:38 2000 +0100 @@ -1,21 +1,30 @@ /* server.c - $Id: server.c 55 2000-05-06 16:56:50Z bears $ + $Id: server.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H #include #endif +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include #include "server.h" #include #include #include -#include #include -#include #include #include "client.h" #include "common.h" @@ -39,6 +48,7 @@ #include "request.h" #include "util.h" #include "wildmat.h" +#include "portable.h" struct { diff -r 9f3a4eccce32 -r 125d79c9e586 src/util.c --- a/src/util.c Mon May 08 17:52:14 2000 +0100 +++ b/src/util.c Tue May 09 23:28:38 2000 +0100 @@ -1,24 +1,35 @@ /* util.c - $Id: util.c 51 2000-05-05 23:49:38Z uh1763 $ + $Id: util.c 60 2000-05-09 22:28:38Z uh1763 $ */ #if HAVE_CONFIG_H #include #endif +#if TIME_WITH_SYS_TIME +#include +#include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "util.h" #include #include #include #include #include -#include #include #include "configfile.h" #include "log.h" #include "wildmat.h" +#include "portable.h" static const char * nextWhiteSpace( const char *p ) diff -r 9f3a4eccce32 -r 125d79c9e586 src/util.h --- a/src/util.h Mon May 08 17:52:14 2000 +0100 +++ b/src/util.h Tue May 09 23:28:38 2000 +0100 @@ -3,7 +3,7 @@ Miscellaneous helper functions. - $Id: util.h 51 2000-05-05 23:49:38Z uh1763 $ + $Id: util.h 60 2000-05-09 22:28:38Z uh1763 $ */ #ifndef UTL_H @@ -13,7 +13,17 @@ #include #endif +#if TIME_WITH_SYS_TIME +#include #include +#else +#if HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #include "common.h" /*