1 /*_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
5 * Function:..General-Headerfile for TWEB *
9 * Authors:...Dr. Kurt Spanier & Bernhard Winkler, *
10 * Zentrum fuer Datenverarbeitung, Bereich Entwicklung *
11 * neuer Dienste, Universitaet Tuebingen, GERMANY *
14 * Creation date: Z D D V V *
15 * August 16 1995 Z D D V V *
16 * Last modification: Z D D V V *
17 * September 13 1999 ZZZZ DDD V *
19 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_*/
22 * $Id: tgeneral.h,v 1.8 1999/09/13 13:47:47 zrnsk01 Exp $
31 #define PRIVATE static
33 /* For changes see file CHANGES */
35 #define _INCLUDE_POSIX_SOURCE
36 #define _INCLUDE_XOPEN_SOURCE
37 #define _INCLUDE_HPUX_SOURCE
38 #define TIOCNOTTY _IO('t', 113)
39 #define getdtablesize() _NFILE
42 #if defined( __linux__ ) && !defined( _BSD_SOURCE )
57 #include <sys/types.h>
58 #include <sys/param.h>
60 #include <sys/socket.h>
61 #include <netinet/in.h>
62 #include <arpa/inet.h>
71 /* Support of LDAP API versions */
72 #if LDAP_API_VERSION >= 2003 && LDAP_API_VERSION <= 2010
75 # if LDAP_API_VERSION >= 2001 && LDAP_API_VERSION <= 2010
82 # define ldap_debug debug
85 # include "portable.h"
86 # include "ldap_log.h"
92 #include "strng_exp.h"
103 #define _TIMEOUT_LEN 31
104 #define _LOG_TIME "%a, %d.%m.%y, %H:%M:%S"
106 #include "init_exp.h"
107 extern GLOB_STRUCT *globP;
110 ***************************************************************************
111 * If you are not a University of Tuebingen site,
112 * you probably want to tailor the following:
113 ***************************************************************************
116 /* Special code for DFN-Project AMBIX-D */
119 # define SELBST_CN glob->selbsteintrag[0]
120 # define SELBST_CN_NAME glob->selbsteintrag[1]
121 # define SELBST_STUDIE_ATTR glob->selbsteintrag[2]
122 # define SELBST_INSERT_MODE glob->selbsteintrag[3]
123 # define SELBST_INSERT_WHO glob->selbsteintrag[4]
124 # define SELBST_INSERT_NO glob->selbsteintrag[5]
125 # define SELBST_INSERT_WORK glob->selbsteintrag[6]
126 # define SELBST_INSERT_ALL glob->selbsteintrag[7]
127 # define SELBST_INSERT_STUD glob->selbsteintrag[8]
129 # define MAXDN_LEN 2048
131 extern void self_insert();
137 /* Flags for print_attr */
159 #define PHONREFSHORT 16
160 #define PHONREFLONG 17
166 /* Patch for hpux from ksp: */
168 # define rewind(a) fflush(a)
171 #define G3TOXBM "cat"
172 #define JPEGTOGIF "/soft/bin/djpeg -gif"
175 *************************************************************************
176 * The rest of this stuff probably does not need to be changed
177 *************************************************************************
181 #define WEB500PORT 8889
185 #define FD_SETSIZE 32
186 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
187 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
188 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
189 #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
192 #define from_hex(c) ((c>='0')&&(c<='9') ? c-'0' : (c>='A')&&(c<='F') ?\
193 c-'A'+10 : (c>='a')&&(c<='f') ? c-'a'+10 : 0)
196 * HTTP request we are implementing
204 * HTTP response status
206 #define DOCUMENT_FOLLOWS 200
208 #define BAD_REQUEST 400
209 #define AUTH_REQUIRED 401
210 #define FORBIDDEN 403
211 #define NOT_FOUND 404
212 #define SERVER_ERROR 500
213 #define NOT_IMPLEMENTED 501
215 #define PRINT_HTML_HEADER (fprintf(fp, \
216 "HTTP/1.0 %d Document follows\n\
220 Content-Type: text/html\n\
223 DOCUMENT_FOLLOWS, version, glob->nowtimestr, glob->nowtimestr,\
224 glob->caching ? glob->expiretimestr : "Pragma: no-cache\n" ))
226 #define PRINT_PLAIN_HEADER (fprintf(fp, \
227 "HTTP/1.0 %d Document follows\n\
231 Content-Type: text/plain\n\
234 DOCUMENT_FOLLOWS, version, glob->nowtimestr, glob->nowtimestr,\
235 glob->caching ? glob->expiretimestr : "Pragma: no-cache\n" ))
237 #define PRINT_REDIRECT_HEADER (fprintf(fp, \
238 "HTTP/1.0 302 Found\n\
243 Content-Type: text/html\n\
246 version, glob->nowtimestr, query, glob->nowtimestr,\
247 glob->caching ? glob->expiretimestr : "Pragma: no-cache\n" ))
249 #define HTML_HEAD_TITLE "<HTML><HEAD><TITLE>%s</TITLE></HEAD><%s>"
251 #define PRINT_HTML_FOOTER (fprintf(fp, "</BODY></HTML>"))
253 /* Meta-Syntax of Gateway-Switching feature */
255 #define GWS_FORMAT "(gw-%s)"
260 /* Separator in UFNs */
263 #endif /* _TGENERAL_ */