00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _DEFS_H_
00022 #define _DEFS_H_
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 #ifdef _POSIX_SOURCE
00029 #error
00030 #endif
00031
00032
00033
00034
00035
00036
00037 #if defined(FREEBSD) || defined(DARWIN)
00038 #define BSD_DERIVED
00039 #endif
00040
00041 #ifndef __EXTENSIONS__
00042 #define UNDEF__EXTENSIONS__
00043 #endif
00044
00045
00046 #if !defined(BSD_DERIVED)
00047 #define SUV_SUS2
00048 #include "suvreq.h"
00049 #endif
00050
00051 #ifdef __GNUC__
00052 #undef _GNU_SOURCE
00053 #define _GNU_SOURCE
00054 #endif
00055
00056 #include <sys/types.h>
00057 #include <unistd.h>
00058
00059 #if !defined(__cplusplus) && !defined(SKIP_BOOL)
00060 #include <stdbool.h>
00061 #endif
00062
00063 #include <signal.h>
00064
00065 #if defined(SOLARIS) || defined(HPUX)
00066 #ifndef __EXTENSIONS__
00067 #define __EXTENSIONS__
00068 #endif
00069 #endif
00070 #include <sys/stat.h>
00071 #if defined(SOLARIS) || defined(HPUX)
00072 #ifdef UNDEF__EXTENSIONS__
00073 #undef __EXTENSIONS__
00074 #endif
00075 #endif
00076
00077
00078 #include <time.h>
00079 #include <limits.h>
00080 #if defined(SOLARIS)
00081 #define _VA_LIST
00082 #endif
00083 #include <stdio.h>
00084 #if defined(SOLARIS)
00085 #undef _VA_LIST
00086 #endif
00087 #include <stdarg.h>
00088 #include <stdlib.h>
00089 #include <stddef.h>
00090 #include <string.h>
00091 #include <strings.h>
00092 #include <ctype.h>
00093 #include <errno.h>
00094 #include <fcntl.h>
00095 #include <assert.h>
00096 #ifndef AUP2_SKIP_WAIT
00097 #include <sys/wait.h>
00098 #endif
00099 #include "ec.h"
00100
00101 #include "logf.h"
00102 #include "options.h"
00103 #include "macrostr.h"
00104 #include "extio.h"
00105
00106
00107
00108
00109
00110 #define PERM_DIRECTORY S_IRWXU
00111 #define PERM_FILE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
00112
00113
00114 bool setblock(int fd, bool on);
00115 #define syserrmsg(buf, buf_max, msg, s_errno)\
00116 syserrmsgtype(buf, buf_max, msg, s_errno, EC_ERRNO)
00117 char *syserrmsgtype(char *buf, size_t buf_max, const char *msg,
00118 int s_errno, EC_ERRTYPE type);
00119 char *syserrmsgline(char *buf, size_t buf_max,
00120 int s_errno, EC_ERRTYPE type);
00121 const char *getdate_strerror(int e);
00122 const char *errsymbol(int errno_arg);
00123 void syserr(const char *msg);
00124 void syserr_print(const char *msg);
00125 void timestart(void);
00126 void timestop(char *msg);
00127
00128 unsigned long getblksize(const char *path);
00129
00130 #ifdef __cplusplus
00131 }
00132 #endif
00133
00134 #endif
00135