X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/bf53e756e0d26c9cdca601e65f2e652bc1bb1b21..268e65c204e5dbcb0f185bdf0f5bb01d8f3f7aee:/agedu.h diff --git a/agedu.h b/agedu.h index 2ad9a5b..5a4e72b 100644 --- a/agedu.h +++ b/agedu.h @@ -2,6 +2,93 @@ * Central header file for agedu, defining various useful things. */ +#include "config.h" + +#ifdef HAVE_FEATURES_H +#define _GNU_SOURCE +#include +#endif + +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_ERRNO_H +# include +#endif +#ifdef HAVE_TIME_H +# include +#endif +#ifdef HAVE_ASSERT_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STDARG_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STDDEF_H +# include +#endif +#ifdef HAVE_LIMITS_H +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif + +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_FCNTL_H +# include +#endif +#ifdef HAVE_SYS_MMAN_H +# include +#endif +#ifdef HAVE_TERMIOS_H +# include +#endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef HAVE_FNMATCH_H +# include +#endif +#ifdef HAVE_PWD_H +# include +#endif +#ifdef HAVE_SYS_WAIT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYSLOG_H +# include +#endif +#ifdef HAVE_SYS_SELECT_H +# include +#endif + #define PNAME "agedu" #define DUMPHDR "agedu dump file. pathsep=" @@ -9,3 +96,16 @@ #define lenof(x) (sizeof((x))/sizeof(*(x))) extern char pathsep; + +#if defined HAVE_LSTAT64 && HAVE_STAT64 +#define STRUCT_STAT struct stat64 +#define LSTAT lstat64 +#define STAT stat64 +#else +#define STRUCT_STAT struct stat +#define LSTAT lstat +#define STAT stat +#endif + +#define max(x,y) ( (x) > (y) ? (x) : (y) ) +#define min(x,y) ( (x) < (y) ? (x) : (y) )