Standardize all protocol header guard macros.
[pidgin-git.git] / libpurple / protocols / zephyr / sysdep.h
blob0b2e5d3fbb9bb9bfe36d98d49d043d395d499b66
1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains system-dependent header code.
4 * Created by: Greg Hudson
6 * Copyright (c) 1988,1991 by the Massachusetts Institute of Technology.
7 * For copying and distribution information, see the file
8 * "mit-copyright.h".
9 */
11 #ifndef PURPLE_ZEPHYR_SYSDEP_H
12 #define PURPLE_ZEPHYR_SYSDEP_H
14 #include <config.h>
15 #include <stdio.h>
16 #include <errno.h>
17 #include <ctype.h>
18 #include <time.h>
19 #include <signal.h>
20 #ifndef WIN32
21 #include <syslog.h>
22 #endif
24 #include <sys/types.h>
25 #include <sys/stat.h>
26 #include <sys/param.h>
27 #include <sys/time.h>
29 #include <stdlib.h>
31 /* Strings. */
32 #include <string.h>
34 /* Exit status handling and wait(). */
35 #ifdef HAVE_SYS_WAIT_H
36 # include <sys/wait.h>
37 #endif
38 #ifndef WEXITSTATUS
39 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
40 #endif
41 #ifndef WIFEXITED
42 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
43 #endif
45 #ifdef HAVE_SYS_CDEFS_H
46 #include <sys/cdefs.h>
47 #endif
49 /* Because we have public header files (and our prototypes need to agree with
50 * those header files, use __STDC__ to guess whether the compiler can handle
51 * stdarg, const, and prototypes. */
52 #ifdef __STDC__
53 # include <stdarg.h>
54 # define VA_START(ap, last) va_start(ap, last)
55 # ifndef __P
56 # define __P(x) x
57 # endif
58 #else
59 # include <varargs.h>
60 # define VA_START(ap, last) va_start(ap)
61 # define const
62 # ifndef __P
63 # define __P(x) ()
64 # endif
65 #endif
67 /* openlog(). */
68 #ifdef LOG_AUTH
69 /* A decent syslog */
70 #define OPENLOG(str, opts, facility) openlog(str, opts, facility)
71 #else
72 /* Probably a 4.2-type syslog */
73 #define OPENLOG(str, opts, facility) openlog(str, opts)
74 #endif
76 #ifdef HAVE_FCNTL_H
77 # include <fcntl.h>
78 #endif
80 #ifdef HAVE_PATHS_H
81 # include <paths.h>
82 # define TEMP_DIRECTORY _PATH_VARTMP
83 #else
84 # define TEMP_DIRECTORY FOUND_TMP
85 #endif
87 #ifdef HAVE_UNISTD_H
88 # include <unistd.h>
89 #else
90 # ifdef HAVE_SYS_FILE_H
91 # include <sys/file.h>
92 # endif
93 uid_t getuid(void);
94 char *ttyname(void);
95 #ifdef HAVE_GETHOSTID
96 ZEPHYR_INT32 gethostid(void);
97 #endif
98 #endif
100 #ifndef STDIN_FILENO
101 #define STDIN_FILENO 0
102 #define STDOUT_FILENO 1
103 #define STDERR_FILENO 2
104 #endif
106 #ifdef HAVE_TERMIOS_H
107 # include <termios.h>
108 #else
109 # ifdef HAVE_SYS_FILIO_H
110 # include <sys/filio.h>
111 # else
112 # ifdef HAVE_SGTTY_H
113 # include <sgtty.h>
114 # endif
115 # ifdef HAVE_SYS_IOCTL_H
116 # include <sys/ioctl.h>
117 # endif
118 # endif
119 #endif
121 /* Kerberos compatibility. */
122 #ifdef ZEPHYR_USES_KERBEROS
123 # include <krb.h>
124 #ifdef WIN32
126 #else
127 # include <krb_err.h>
128 #endif /* WIN32 */
129 # include <des.h>
130 #ifndef WIN32
131 # ifndef HAVE_KRB_GET_ERR_TEXT
132 # define krb_get_err_text(n) krb_err_txt[n]
133 # endif
134 #endif /* WIN32 */
135 # ifndef HAVE_KRB_LOG
136 # define krb_log log
137 # endif
138 #endif /* ZEPHYR_USES_KERBEROS */
140 #ifdef HAVE_SYS_UIO_H
141 # include <sys/uio.h>
142 #endif
144 #ifdef HAVE_SYS_UTSNAME_H
145 # include <sys/utsname.h>
146 #endif
148 #ifdef HAVE_SYS_SELECT_H
149 # include <sys/select.h>
150 #endif
152 #ifdef HAVE_SYS_MSGBUF_H
153 #include <sys/msgbuf.h>
154 #endif
156 #ifndef MSG_BSIZE
157 #define MSG_BSIZE BUFSIZ
158 #endif
160 #endif /* PURPLE_ZEPHYR_SYSDEP_H */