Annotation of libwww/Library/src/wwwsys.html, revision 2.94
2.7 timbl 1: <HTML>
2: <HEAD>
2.89 frystyk 3: <TITLE>W3C Reference Library libwww SYSTEM DEPENDENCIES</TITLE>
2.94 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 8-Apr-1996 -->
2.7 timbl 5: </HEAD>
2.2 timbl 6: <BODY>
2.35 frystyk 7:
8: <H1>System Dependencies</H1>
9:
10: <PRE>
11: /*
2.49 frystyk 12: ** (c) COPYRIGHT MIT 1995.
2.35 frystyk 13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
16:
17: System-system differences for TCP include files and macros. This file
18: includes for each system the files necessary for network and file
19: I/O. <P>
20:
21: This module is a part of the <A
2.88 frystyk 22: HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference Library</A>.
2.26 frystyk 23:
2.2 timbl 24: <H3>Authors</H3>
25: <DL>
26: <DT>TBL
2.55 frystyk 27: <DD> Tim Berners-Lee, W3 project, CERN, <timbl@w3.org>
2.2 timbl 28: <DT>EvA
2.26 frystyk 29: <DD> Eelco van Asperen <evas@cs.few.eur.nl>
2.2 timbl 30: <DT>MA
31: <DD> Marc Andreesen NCSA
2.7 timbl 32: <DT>MD
2.26 frystyk 33: <DD> Mark Donszelmann <duns@vxcern.cern.ch>
2.2 timbl 34: <DT>AT
2.26 frystyk 35: <DD> Aleksandar Totic <atotic@ncsa.uiuc.edu>
2.4 timbl 36: <DT>SCW
2.26 frystyk 37: <DD> Susan C. Weber <sweber@kyle.eitech.com>
38: <DT>HF
2.55 frystyk 39: <DD> Henrik Frystyk, <frystyk@w3.org>
2.41 frystyk 40: <DT>CLB
2.48 frystyk 41: <DD> Charlie Brooks, <cbrooks@osf.org>
2.2 timbl 42: </DL>
43:
44: <H3>History:</H3>
45: <DL>
46: <DT>22 Feb 91
2.88 frystyk 47: <DD> Written (TBL) as part of the WWW library.
2.2 timbl 48: <DT>16 Jan 92
2.7 timbl 49: <DD> PC code from (EvA)
2.2 timbl 50: <DT>22 Apr 93
2.88 frystyk 51: <DD>Merged diffs bits from xmosaic release
2.4 timbl 52: <DT>29 Apr 93
2.41 frystyk 53: <DD>Windows/NT code from (SCW)
2.7 timbl 54: <DT>29 Sep 93
2.48 frystyk 55: <DD>Mar 96 CLB - changed SLEEP() macro for Windows/NT MSC compiler
56: added BOOLEAN_DEFINED macro to avoid duplicate definitions in HUtils.h
57: changed netread() macros to support reading from stdin,etc. as well
58: as sockets. (Required for linemode browser to work).
2.88 frystyk 59: <DT>Henrik
60: <DD>Changed to support autoconf for Unix
2.2 timbl 61: </DL>
62:
2.1 timbl 63: <PRE>
2.88 frystyk 64: #ifndef SYSDEP_H
65: #define SYSDEP_H
2.26 frystyk 66: </PRE>
67:
2.88 frystyk 68: <H1>Platform Specific Stuff</H1>
2.1 timbl 69:
2.88 frystyk 70: <H2>Unix</H2>
2.43 frystyk 71:
2.88 frystyk 72: We rely on autoconf to do the dirty job. If you have any changhes then please add them to the <A HREF="../configure">configure script</A>
2.26 frystyk 73:
74: <PRE>
2.88 frystyk 75: #ifdef HAVE_CONFIG_H
76: #include <config.h>
2.1 timbl 77: #endif
2.26 frystyk 78: </PRE>
2.1 timbl 79:
2.88 frystyk 80: <H2>Microsoft Windows Win32 API</H2>
2.37 frystyk 81:
2.83 frystyk 82: Help provided by Eric Prud'hommeaux, Susan C. Weber
83: <sweber@kyle.eitech.com>, Paul Hounslow
84: <P.M.Hounslow@reading.ac.uk>, and a lot of other PC people.
2.26 frystyk 85:
86: <PRE>
2.83 frystyk 87: #if defined(_WINDOWS) || defined(_CONSOLE)
88: #define WWW_MSWINDOWS
89: #endif
90:
91: #if defined(_WINDOWS) && !defined (_CONSOLE)
92: #define WWW_WIN_WINDOW
93: #endif
94:
95: #if defined(_CONSOLE)
96: #define WWW_WIN_CONSOLE
97: #endif
98:
2.84 frystyk 99: #ifdef WWW_MSWINDOWS
2.37 frystyk 100: #include <windows.h>
101: #include <fcntl.h>
102: #include <sys\types.h>
103: #include <sys\stat.h>
104:
105: #define NETREAD(s,b,l) recv((s),(b),(l),0)
106: #define NETWRITE(s,b,l) send((s),(b),(l),0)
107: #define NETCLOSE(s) closesocket(s)
108: #define IOCTL(s,c,a) ioctlsocket(s,c, (long *) a)
2.4 timbl 109:
2.41 frystyk 110: #define MKDIR(a,b) mkdir((a))
2.56 frystyk 111: #define REMOVE(a) remove((a))
2.47 frystyk 112: #define DEFAULT_SUFFIXES "."
2.41 frystyk 113:
2.59 frystyk 114: #ifdef TTY_IS_SELECTABLE
115: #undef TTY_IS_SELECTABLE
116: #endif
117:
2.32 frystyk 118: #include <io.h>
119: #include <string.h>
120: #include <process.h>
121: #include <time.h>
122: #include <direct.h>
2.88 frystyk 123:
124: #define HAVE_STDIO_H
125:
2.37 frystyk 126: #include <stdlib.h>
2.32 frystyk 127: #include <winsock.h>
2.37 frystyk 128:
2.78 frystyk 129: #ifndef _CONSOLE
130: #define NO_STDIO
2.37 frystyk 131: #endif
132:
2.88 frystyk 133: #undef HAVE_GETPASS
134: #undef HAVE_ALTZONE
2.37 frystyk 135: #define NO_GETWD
2.88 frystyk 136: #define HAVE_GETCWD
2.91 frystyk 137: #define BOOLEAN /* Windows have BOOLEAN defined */
2.73 frystyk 138:
2.88 frystyk 139: #undef HAVE_GETDOMAINNAME
2.37 frystyk 140:
2.79 frystyk 141: #define SOCKET SOCKET /* WinSocks socket descriptor */
2.37 frystyk 142: #define INVSOC INVALID_SOCKET /* WinSocks invalid socket */
143:
144: #define DESIRED_WINSOCK_VERSION 0x0101 /* we'd like winsock ver 1.1... */
145: #define MINIMUM_WINSOCK_VERSION 0x0101 /* ...but we'll take ver 1.1 :) */
146: </PRE>
147:
2.85 frystyk 148: <H3>File and Directory Access</H3>
2.37 frystyk 149:
150: These next defintions are because the UNIX stuff is not supplied with
2.91 frystyk 151: BC4 (Paul Hounslow <P.M.Hounslow@reading.ac.uk>)
2.37 frystyk 152:
153: <PRE>
154: #define NO_UNIX_IO
155:
156: typedef unsigned long mode_t;
157:
2.84 frystyk 158: #define _IFMT 0170000 /* type of file */
159: #define _IFDIR 0040000 /* directory */
160: #define _IFCHR 0020000 /* character special */
161: #define _IFBLK 0060000 /* block special */
162: #define _IFREG 0100000 /* regular */
163: #define _IFLNK 0120000 /* symbolic link */
164: #define _IFSOCK 0140000 /* socket */
165: #define _IFIFO 0010000 /* fifo */
2.37 frystyk 166:
167: #define S_ISUID 0004000 /* set user id on execution */
168: #define S_ISGID 0002000 /* set group id on execution */
169: #define S_ISVTX 0001000 /* save swapped text even after use */
170:
171: #ifdef S_IREAD
172: #undef S_IREAD
173: #define S_IREAD 0000400 /* read permission, owner */
174: #endif
175:
176: #ifdef S_IWRITE
177: #undef S_IWRITE
178: #define S_IWRITE 0000200 /* write permission, owner */
179: #endif
180:
181: #ifdef S_IEXEC
182: #undef S_IEXEC
183: #define S_IEXEC 0000100 /* execute/search permission, owner */
184: #endif
185:
186: #define S_ENFMT 0002000 /* enforcement-mode locking */
187:
188: #ifdef S_IFMT
189: #undef S_IFMT
190: #define S_IFMT _IFMT
191: #endif
192:
193: #ifdef S_IDIR
194: #undef S_IDIR
195: #define S_IFDIR _IFDIR
196: #endif
197:
198: #ifdef S_IFCHR
199: #undef S_IFCHR
200: #define S_IFCHR _IFCHR
201: #endif
202:
203: #ifdef S_IBLK
204: #undef S_IBLK
205: #define S_IFBLK _IFBLK
206: #endif
207:
208: #ifdef S_IREG
209: #undef S_IREG
210: #define S_IFREG _IFREG
211: #endif
212:
213: #define S_IFLNK _IFLNK
214:
215: #ifdef S_IFIFO
216: #undef S_IFIFO
217: #define S_IFIFO _IFIFO
218: #endif
219:
220: #define S_IRWXU 0000700 /* rwx, owner */
221: #define S_IRUSR 0000400 /* read permission, owner */
222: #define S_IWUSR 0000200 /* write permission, owner */
223: #define S_IXUSR 0000100 /* execute/search permission, owner */
224: #define S_IRWXG 0000070 /* rwx, group */
225: #define S_IRGRP 0000040 /* read permission, group */
226: #define S_IWGRP 0000020 /* write permission, grougroup */
227: #define S_IXGRP 0000010 /* execute/search permission, group */
228: #define S_IRWXO 0000007 /* rwx, other */
229: #define S_IROTH 0000004 /* read permission, other */
230: #define S_IWOTH 0000002 /* write permission, other */
231: #define S_IXOTH 0000001 /* execute/search permission, other */
232:
233: #define S_ISREG(m) (((m)&_IFMT) == _IFREG)
234: </PRE>
235:
236: <H3>Errno and Return Codes</H3>
237:
238: Winsock has its own errno codes and it returns them through
239: WSAGetLastError(). However, it does also support BSD error codes, so
2.85 frystyk 240: we make a compromise. WSA definitions moved from _WIN32 ifdef by EGP
2.37 frystyk 241:
242: <PRE>
243: #define socerrno WSAGetLastError()
244: #define ERRNO_DONE
245: </PRE>
246:
2.85 frystyk 247: Return code for socket functions. We can't use -1 as return value <P>
2.2 timbl 248:
2.77 frystyk 249: <PRE>
250: #define EWOULDBLOCK WSAEWOULDBLOCK
251: #define EINPROGRESS WSAEINPROGRESS
252: #define ECONNREFUSED WSAECONNREFUSED
253: #define ETIMEDOUT WSAETIMEDOUT
254: #define ENETUNREACH WSAENETUNREACH
255: #define EHOSTUNREACH WSAEHOSTUNREACH
256: #define EHOSTDOWN WSAEHOSTDOWN
257: #define EISCONN WSAEISCONN
2.38 frystyk 258:
2.48 frystyk 259: /* Some compilers do only define WIN32 and NOT _WINDOWS */
2.77 frystyk 260: #define NO_GROUPS
2.85 frystyk 261:
2.77 frystyk 262: #ifdef _WIN32
2.85 frystyk 263: #define MKDIR(a,b) mkdir((a)) /* CLB NT has mkdir, but only one arg */
2.77 frystyk 264: #define SLEEP(n) Sleep((n)*1000)
265: #else
2.85 frystyk 266: #define MKDIR(a,b) _mkdir((a)) /* CLB NT has mkdir, but only one arg */
2.50 frystyk 267: #endif /* WIN32 */
2.84 frystyk 268:
269: #endif /* WWW_MSWINDOWS */
2.38 frystyk 270: </PRE>
271:
2.88 frystyk 272: <H2>Macintosh - Metrowerks Codewarrior 6</H2>
273:
274: Metrowerks Codewarrior is one development environment on the Mac. We
275: are using GUSI (1.5.9) by Matthias Neeracher
276: <neeri@iis.ee.ethz.ch> for our socket lib. You can find more
277: information about the GUSI Library at
278: <CODE>http://err.ethz.ch/members/neeri/macintosh/gusiman/GUSI.html</CODE><P>
279:
280: Compiles on PPC. Should compile on 68K. <P>
281:
282: August 31, 1995 by Steven T. Roussey <sroussey@eng.uci.edu> (STR)
283:
284: <PRE>
285: #ifdef __MWERKS__
286: #include <gusi.h>
287: #include <dirent.h>
288: #include <errno.h>
289: #include <sys/errno.h>
290: #include <sioux.h>
291:
292: #define INCLUDES_DONE
293: #define TCP_INCLUDES_DONE
294:
295: #define GUSI /* Identifies changes made for GUSI */
296:
297: #undef HAVE_GETDOMAINNAME /* STR */
298: #undef HAVE_GETPASS
299: #undef HAVE_GETWD
300:
301: #define HAVE_GETCWD
302: #define USE_DIRENT
303: #define NO_GROUPS
304: #define GOT_READ_DIR
305:
306: #undef HAVE_TIMEZONE /* STR */
307: #define NO_GMTOFF
308: #define HAVE_STRERROR
309:
310: #define DIR struct dirent
311: #define d_ino d_fileno /* backward compatibility */
312:
313: #define SLEEP(n) GUSIDefaultSpin( SP_SLEEP, n/60)
314:
315: #define MKDIR(a,b) mkdir(a)
316: #endif
317: </PRE>
318:
319: <H2>Macintosh - MPW</H2>
320:
321: MPW is one development environment on the Mac.<P>
322:
323: This entry was created by Aleksandar Totic (atotic@ncsa.uiuc.edu) this
324: file is compatible with sockets package released by NCSA. One major conflict
325: is that this library redefines write/read/etc as macros. In some of HTML code
326: these macros get executed when they should not be. Such files should
327: define NO_SOCKET_DEFS on top. This is a temporary hack.
328:
329: <PRE>
330: #ifdef applec /* MPW */
331: #undef HAVE_SYSTEM
332: #define DEBUG /* Can't put it on the CC command line */
333:
334: #define NO_UNIX_IO /* getuid() missing */
335: #undef HAVE_GETPID /* getpid() does not exist */
336: #define NO_GETWD /* getwd() does not exist */
337:
338: #define NETCLOSE s_close /* Routine to close a TCP-IP socket */
339: #define NETREAD s_read /* Routine to read from a TCP-IP socket */
340: #define NETWRITE s_write /* Routine to write to a TCP-IP socket */
341:
342: #define _ANSI_SOURCE
343: #define GUI
344: #define LINEFEED 10
345: #define ANON_FTP_HOSTNAME
346: #ifndef NO_SOCKET_DEFS
347: #include <MacSockDefs.h>
348: #endif /* NO_SOCKET_DEFS */
349:
350: #include <socket.ext.h>
351: #include <string.h>
352:
353: #endif /* applec MPW */
354: </PRE>
355:
356: <H2>IBM VM-CMS, VM-XA Mainframes</H2>
357:
358: MVS is compiled as for VM. MVS has no unix-style I/O. The command line
359: compile options seem to come across in lower case.
360:
361: <PRE>
362: #ifdef mvs
363: #define MVS
364: #endif
365:
366: #ifdef MVS
367: #define VM
368: #endif
369:
370: #ifdef NEWLIB
371: #pragma linkage(newlib,OS) /* Enables recursive NEWLIB */
372: #endif
373:
374: /* VM doesn't have a built-in predefined token, so we cheat: */
375: #ifndef VM
376: #include <string.h> /* For bzero etc - not VM */
377: #endif
378:
379: /* Note: All include file names must have 8 chars max (+".h")
380: **
381: ** Under VM, compile with "(DEF=VM,SHORT_NAMES,DEBUG)"
382: **
383: ** Under MVS, compile with "NOMAR DEF(MVS)" to get rid of 72 char margin
384: ** System include files TCPIP and COMMMAC neeed line number removal(!)
385: */
386:
387: #ifdef VM /* or MVS -- see above. */
388: #define GOT_PIPE /* Of sorts */
389: #define NOT_ASCII /* char type is not ASCII */
390: #define NO_UNIX_IO /* Unix I/O routines are not supported */
391: #undef HAVE_GETPID /* getpid() does not exist */
392: #define NO_GETWD /* getwd() does not exist */
393: #ifndef SHORT_NAMES
394: #define SHORT_NAMES /* 8 character uniqueness for globals */
395: #endif
396: #include <manifest.h>
397: #include <bsdtypes.h>
398: #include <stdefs.h>
399: #include <socket.h>
400: #include <in.h>
401: #include <inet.h>
402: #include <netdb.h>
403: #include <errno.h> /* independent */
404: extern char asciitoebcdic[], ebcdictoascii[];
405: #define TOASCII(c) (c=='\n' ? 10 : ebcdictoascii[c])
406: #define FROMASCII(c) (c== 10 ? '\n' : asciitoebcdic[c])
407: #include <bsdtime.h>
408: #include <time.h>
409: #include <string.h>
410: #define INCLUDES_DONE
411: #define TCP_INCLUDES_DONE
412: #define SIMPLE_TELNET
413: #endif
414: </PRE>
415:
416: <H2>IBM-PC running MS-DOS with SunNFS for TCP/IP</H2>
417: This code thanks to Eelco van Asperen <evas@cs.few.eur.nl>
418:
419: <PRE>
420: #ifdef PCNFS
421: #include <sys/types.h>
422: #include <string.h>
423: #include <errno.h> /* independent */
424: #include <sys/time.h> /* independent */
425: #include <sys/stat.h>
426: #include <fcntl.h> /* In place of sys/param and sys/file */
427: #define INCLUDES_DONE
428: #define FD_SET(fd,pmask) (*(unsigned*)(pmask)) |= (1<<(fd))
429: #define FD_CLR(fd,pmask) (*(unsigned*)(pmask)) &= ~(1<<(fd))
430: #define FD_ZERO(pmask) (*(unsigned*)(pmask))=0
431: #define FD_ISSET(fd,pmask) (*(unsigned*)(pmask) & (1<<(fd)))
432: #define NO_GROUPS
433: #endif /* PCNFS */
434: </PRE>
435:
2.26 frystyk 436: <H2>VAX/VMS</H2>
2.38 frystyk 437:
2.26 frystyk 438: Under VMS, there are many versions of TCP-IP. Define one if you do not
2.4 timbl 439: use Digital's UCX product:
2.38 frystyk 440:
2.4 timbl 441: <DL>
442: <DT>UCX
2.5 timbl 443: <DD> DEC's "Ultrix connection" (default)
2.4 timbl 444: <DT>WIN_TCP
2.5 timbl 445: <DD> From Wollongong, now GEC
446: software.
2.4 timbl 447: <DT>MULTINET
2.5 timbl 448: <DD> From SRI, now from TGV Inv.
2.4 timbl 449: <DT>DECNET
2.5 timbl 450: <DD> Cern's TCP socket emulation
2.4 timbl 451: over DECnet
452: </DL>
2.37 frystyk 453:
454: The last three do not interfere with the unix i/o library, and so they
455: need special calls to read, write and close sockets. In these cases
456: the socket number is a VMS channel number, so we make the @@@ HORRIBLE
457: @@@ assumption that a channel number will be greater than 10 but a
458: unix file descriptor less than 10. It works.
2.26 frystyk 459:
460: <PRE>
2.76 frystyk 461: #ifdef VMS
462: #include "HTVMSUtils.h"
2.47 frystyk 463: #define CACHE_FILE_PREFIX "SYS$LOGIN:Z_"
464: #define DEFAULT_SUFFIXES "._"
2.7 timbl 465:
2.88 frystyk 466: #define HAVE_CUSERID
467:
2.7 timbl 468: #ifdef WIN_TCP
2.32 frystyk 469: #define NETREAD(s,b,l) ((s)>10 ? netread((s),(b),(l)) : read((s),(b),(l)))
470: #define NETWRITE(s,b,l) ((s)>10 ? netwrite((s),(b),(l)) : write((s),(b),(l)))
471: #define NETCLOSE(s) ((s)>10 ? netclose(s) : close(s))
2.16 duns 472: #endif /* WIN_TCP */
2.1 timbl 473:
474: #ifdef MULTINET
475: #undef NETCLOSE
476: #undef NETREAD
477: #undef NETWRITE
2.32 frystyk 478: #define NETREAD(s,b,l) ((s)>10 ? socket_read((s),(b),(l)) : read((s),(b),(l)))
479: #define NETWRITE(s,b,l) ((s)>10 ? socket_write((s),(b),(l)) : \
2.1 timbl 480: write((s),(b),(l)))
2.32 frystyk 481: #define NETCLOSE(s) ((s)>10 ? socket_close(s) : close(s))
2.37 frystyk 482: #define IOCTL(s,c,a) socket_ioctl(s,c,a);
2.16 duns 483: #endif /* MULTINET */
2.1 timbl 484:
485: #ifdef DECNET
2.74 frystyk 486: #define DNP_OBJ 80 /* This one doesn't look busy, but we must check */
487: /* That one was for decnet */
488: #undef SELECT /* not supported */
2.32 frystyk 489: #define NETREAD(s,b,l) ((s)>10 ? recv((s),(b),(l),0) : read((s),(b),(l)))
490: #define NETWRITE(s,b,l) ((s)>10 ? send((s),(b),(l),0) : write((s),(b),(l)))
491: #define NETCLOSE(s) ((s)>10 ? socket_close(s) : close(s))
2.73 frystyk 492:
2.88 frystyk 493: #undef HAVE_GETHOSTNAME /* Decnet doesn't have a name server */
2.1 timbl 494: #endif /* Decnet */
2.73 frystyk 495:
2.88 frystyk 496: #undef HAVE_GETDOMAINNAME
2.31 duns 497:
2.1 timbl 498: /* Certainly this works for UCX and Multinet; not tried for Wollongong
499: */
500: #ifdef MULTINET
2.32 frystyk 501: #include <time.h>
2.16 duns 502: #ifdef __TIME_T
503: #define __TYPES
504: #define __TYPES_LOADED
505: #endif /* __TIME_T */
2.37 frystyk 506: #include <multinet_root:[multinet.include.sys]types.h>
507: #include <multinet_root:[multinet.include]errno.h>
2.16 duns 508: #ifdef __TYPES
509: #define __TIME_T
510: #endif /* __TYPE */
511: #ifdef __TIME_LOADED
512: #define __TIME
513: #endif /* __TIME_LOADED */
2.37 frystyk 514: #include <multinet_root:[multinet.include.sys]time.h>
2.16 duns 515: #else /* not MULTINET */
2.32 frystyk 516: #include <types.h>
517: #include <errno.h>
518: #include <time.h>
2.16 duns 519: #endif /* not MULTINET */
2.1 timbl 520:
521: #include string
522:
523: #ifndef STDIO_H
2.24 luotonen 524: #include <stdio>
2.1 timbl 525: #define STDIO_H
526: #endif
527:
528: #include file
529:
2.37 frystyk 530: #ifndef DECNET /* Why is it used at all ? Types conflict with "types.h> */
2.1 timbl 531: #include unixio
532: #endif
533:
534: #define INCLUDES_DONE
535:
536: #ifdef MULTINET /* Include from standard Multinet directories */
2.37 frystyk 537: #include <multinet_root:[multinet.include.sys]socket.h>
2.1 timbl 538: #ifdef __TIME_LOADED /* defined by sys$library:time.h */
539: #define __TIME /* to avoid double definitions in next file */
540: #endif
2.37 frystyk 541: #include <multinet_root:[multinet.include.netinet]in.h>
542: #include <multinet_root:[multinet.include.arpa]inet.h>
543: #include <multinet_root:[multinet.include]netdb.h>
544: #include <multinet_root:[multinet.include.sys]ioctl.h>
2.1 timbl 545:
546: #else /* not multinet */
547: #ifdef DECNET
2.37 frystyk 548: #include <types.h> /* for socket.h */
549: #include <socket.h>
2.65 frystyk 550: #include <dn>
551: #include <dnetdb>
2.1 timbl 552:
553: #else /* UCX or WIN */
2.16 duns 554: #ifdef CADDR_T
555: #define __CADDR_T
556: #endif /* problem with xlib.h inclusion */
2.32 frystyk 557: #include <socket.h>
558: #include <in.h>
559: #include <inet.h>
560: #include <netdb.h>
561: #include <ucx$inetdef.h>
2.1 timbl 562:
563: #endif /* not DECNET */
564: #endif /* of Multinet or other TCP includes */
565:
566: #define TCP_INCLUDES_DONE
2.63 frystyk 567:
568: #ifdef UCX
569: #define SIMPLE_TELNET
570: #endif
2.26 frystyk 571: </PRE>
2.1 timbl 572:
2.31 duns 573: On VMS directory browsing is available through a separate
574: copy of dirent.c. The definition of R_OK seem to be missing
575: from the system include files...
576:
577: <PRE>
578: #define USE_DIRENT
2.37 frystyk 579: #define GOT_READ_DIR
580: #include <dirent.h>
2.88 frystyk 581: #define DIR struct dirent
2.31 duns 582: #define R_OK 4
583: </PRE>
584:
2.37 frystyk 585: On VMS machines, the linker needs to be told to put global data
586: sections into a data segment using these storage
2.7 timbl 587: classes. (MarkDonszelmann)
2.26 frystyk 588:
589: <PRE>
590: #ifdef VAXC
2.7 timbl 591: #define GLOBALDEF globaldef
592: #define GLOBALREF globalref
593: #endif /* VAXC */
2.1 timbl 594: #endif /* vms */
2.26 frystyk 595: </PRE>
2.1 timbl 596:
2.26 frystyk 597: On non-VMS machines, the GLOBALDEF and GLOBALREF storage types default
2.7 timbl 598: to normal C storage types.
2.26 frystyk 599:
600: <PRE>
601: #ifndef GLOBALREF
2.7 timbl 602: #define GLOBALDEF
603: #define GLOBALREF extern
604: #endif
2.31 duns 605: </PRE>
606:
2.66 frystyk 607: On non-VMS machines STAT should be stat...On VMS machines
608: STAT is a function that converts directories and devices so that you
2.31 duns 609: can stat them.
610:
611: <PRE>
612: #ifdef VMS
2.37 frystyk 613: typedef unsigned long mode_t;
2.69 frystyk 614: #define HT_STAT HTStat
615: #define HT_LSTAT HTStat
616: #else
617: #define HT_STAT stat
618: #define HT_LSTAT lstat
2.31 duns 619: #endif /* non VMS */
2.26 frystyk 620: </PRE>
2.7 timbl 621:
2.88 frystyk 622: <H3>Dynamic Memory</H3>
623:
624: Replace memory allocation and free C RTL functions with VAXC$xxx_OPT
625: alternatives for VAXC (but not DECC) on VMS. This makes a big
626: performance difference. (Foteos Macrides). Also have a look at the <A
627: HREF="HTMemory.html">Dynamic Memory Module</A> for how to handle
628: <CODE>malloc</CODE> and <CODE>calloc</CODE>.
629:
630: <PRE>
631: #ifdef VMS
632: #include <stdio.h>
633: #include <stdlib.h>
634: #include <unixlib.h>
635: #include <ctype.h>
636: #if defined(VAXC) && !defined(__DECC)
637: #define malloc VAXC$MALLOC_OPT
638: #define calloc VAXC$CALLOC_OPT
639: #define free VAXC$FREE_OPT
640: #define cfree VAXC$CFREE_OPT
641: #define realloc VAXC$REALLOC_OPT
642: #endif /* VAXC but not DECC */
643: #define unlink remove
644: #define gmtime localtime
645: #include <stat.h>
646: #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
647: #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
648: #define putenv HTVMS_putenv
649: #endif /* VMS */
650: </PRE>
651:
2.41 frystyk 652: <H3>Strftime and other time stuff</H3>
653:
654: <PRE>
655: #ifdef VMS
656: #ifndef DECC
2.88 frystyk 657: #undef HAVE_STRFTIME
2.41 frystyk 658: #endif
2.88 frystyk 659: #undef HAVE_MKTIME
660: #undef HAVE_TIMEGM
2.41 frystyk 661: #define NO_GMTOFF
2.88 frystyk 662: #undef HAVE_TIMEZONE
2.41 frystyk 663: #endif
2.90 eric 664:
665: #ifdef WWW_MSWINDOWS
666: #define HAVE_MKTIME
667: #define HAVE_STRFTIME
668: #endif
2.41 frystyk 669: </PRE>
670:
2.37 frystyk 671: <H3>Definition of Errno</H3>
672:
673: <PRE>
674: #ifdef VMS
675: #ifndef __DECC
676: extern int uerrno; /* Deposit of error info (as per errno.h) */
677: extern volatile noshare int socket_errno; /* socket VMS error info
678: (used for translation of vmserrno) */
679: extern volatile noshare int vmserrno; /* Deposit of VMS error info */
680: extern volatile noshare int errno; /* noshare to avoid PSECT conflict */
681: #define ERRNO_DONE
682: #endif /* not DECC */
683: #endif /* VMS */
684: </PRE>
685:
2.88 frystyk 686: <HR>
2.1 timbl 687:
2.88 frystyk 688: <H1>Platform Independent Stuff</H1>
2.32 frystyk 689:
2.88 frystyk 690: Here we use all the knowledge we got above...
2.1 timbl 691:
2.88 frystyk 692: <H2>Include Files</H2>
2.40 frystyk 693:
2.88 frystyk 694: This file includes all system header files that are needed, iff they
695: exist. Their existance is discovered by <CODE>configure</CODE>.
2.40 frystyk 696:
697: <PRE>
2.88 frystyk 698: /* stdio.h */
699: #ifdef HAVE_STDIO_H
700: #include <stdio.h>
2.40 frystyk 701: #endif
702:
2.88 frystyk 703: /* types.h */
704: #ifdef HAVE_SYS_TYPES_H
705: #include <sys/types.h>
706: #else
707: #ifdef HAVE_TYPES_H
708: #include <types.h>
2.42 frystyk 709: #endif
2.32 frystyk 710: #endif
711:
2.88 frystyk 712: /* unistd.h */
713: #ifdef HAVE_UNISTD_H
2.28 luotonen 714: #include <unistd.h>
2.88 frystyk 715: #else
716: #ifdef HAVE_SYS_UNISTD_H
717: #include <sys/unistd.h>
718: #endif
2.32 frystyk 719: #endif
720:
2.88 frystyk 721: /* fcntl.h */
722: #ifdef HAVE_FCNTL_H
2.28 luotonen 723: #include <fcntl.h>
724: #else
2.88 frystyk 725: #ifdef HAVE_SYS_FCNTL_H
2.28 luotonen 726: #include <sys/fcntl.h>
727: #endif
2.88 frystyk 728: #endif
2.28 luotonen 729:
2.88 frystyk 730: /* limits.h */
731: #ifdef HAVE_SYS_LIMITS_H
732: #include <sys/limits.h>
733: #else
734: #ifdef HAVE_LIMITS_H
2.32 frystyk 735: #include <limits.h>
2.88 frystyk 736: #endif
737: #endif
2.41 frystyk 738:
2.88 frystyk 739: /* stat.h */
740: #ifdef HAVE_SYS_STAT_H
741: #include <sys/stat.h>
742: #else
743: #ifdef HAVE_STAT_H
744: #include <stat.h>
745: #endif
2.41 frystyk 746: #endif
747:
2.88 frystyk 748: /* file.h */
749: #ifdef HAVE_SYS_FILE_H
750: #include <sys/file.h>
751: #endif
2.37 frystyk 752:
2.88 frystyk 753: /* systeminfo.h */
754: #ifdef HAVE_SYS_SYSTEMINFO_H
755: #include <sys/systeminfo.h>
756: #endif
2.37 frystyk 757:
2.88 frystyk 758: /* ioctl.h */
759: #ifdef HAVE_SYS_IOCTL_H
760: #include <sys/ioctl.h>
761: #endif
2.32 frystyk 762:
2.88 frystyk 763: /* time.h */
764: #ifdef TIME_WITH_SYS_TIME
765: #include <sys/time.h>
766: #include <time.h>
767: #else
768: #ifdef HAVE_SYS_TIME_H
769: #include <sys/time.h>
770: #else
771: #ifdef HAVE_TIME_H
2.28 luotonen 772: #include <time.h>
2.88 frystyk 773: #endif
774: #endif
775: #endif
2.28 luotonen 776:
2.88 frystyk 777: /* string{,s}.h */
778: #ifdef HAVE_STRING_H
779: #include <string.h>
780: #endif
781: #ifdef HAVE_STRINGS_H
782: #include <strings.h>
2.41 frystyk 783: #endif
2.28 luotonen 784:
2.88 frystyk 785: /* syslog.h */
786: #ifdef HAVE_SYSLOG_H
787: #include <syslog.h>
788: #endif
2.28 luotonen 789:
2.88 frystyk 790: /* socket.h */
791: #ifdef HAVE_SYS_SOCKET_H
792: #include <sys/socket.h>
793: #else
794: #ifdef HAVE_SOCKET_H
795: #include <socket.h>
796: #endif
797: #endif
2.44 frystyk 798:
2.88 frystyk 799: /* socket.ext.h */
800: #ifdef HAVE_SOCKET_EXT_H
801: #include <socket.ext.h>
802: #endif
2.43 frystyk 803:
2.88 frystyk 804: /* appkit.h */
805: #ifdef HAVE_APPKIT_APPKIT_H
2.91 frystyk 806: #include <appkit/appkit.h>
2.88 frystyk 807: #else
808: #ifdef HAVE_APPKIT_H
2.91 frystyk 809: #include <appkit.h>
2.88 frystyk 810: #endif
811: #endif
2.43 frystyk 812:
2.88 frystyk 813: /* in.h */
814: #ifdef HAVE_NETINET_IN_H
815: #include <netinet/in.h>
816: #else
817: #ifdef HAVE_IN_H
818: #include <in.h>
819: #endif
2.43 frystyk 820: #endif
2.21 frystyk 821:
2.88 frystyk 822: /* dn.h */
823: #ifdef HAVE_DN_H
824: #include <dn.h>
825: #endif
2.22 luotonen 826:
2.88 frystyk 827: /* ipc.h */
828: #ifdef HAVE_SYS_IPC_H
2.30 luotonen 829: #include <sys/ipc.h>
2.88 frystyk 830: #endif
2.41 frystyk 831:
2.88 frystyk 832: /* errno.h */
833: #ifdef HAVE_ERRNO_H
834: #include <errno.h>
835: #else
836: #ifdef HAVE_SYS_ERRNO_H
837: #include <sys/errno.h>
838: #else
839: #ifdef HAVE_NET_ERRNO_H
2.30 luotonen 840: #include <net/errno.h>
2.88 frystyk 841: #endif
842: #endif
843: #endif
2.22 luotonen 844:
2.88 frystyk 845: /* pwd.h */
846: #ifdef HAVE_PWD_H
847: #include <pwd.h>
848: #endif
2.22 luotonen 849:
2.88 frystyk 850: /* grp.h */
851: #ifdef HAVE_GRP_H
852: #include <grp.h>
853: #endif
2.21 frystyk 854:
2.88 frystyk 855: /* inet.h */
856: #ifdef HAVE_ARPA_INET_H
857: #include <arpa/inet.h>
858: #else
859: #ifdef HAVE_INET_H
860: #include <inet.h>
861: #endif
862: #endif
2.41 frystyk 863:
2.88 frystyk 864: /* netdb.h */
865: #ifdef HAVE_NETDB_H
866: #include <netdb.h>
867: #endif
2.41 frystyk 868:
2.88 frystyk 869: /* manifest.h */
870: #ifdef HAVE_MANIFEST_H
871: #include <manifest.h>
872: #endif
2.15 luotonen 873:
2.88 frystyk 874: /* bsdtypes.h */
875: #ifdef HAVE_BSDTYPES_H
876: #include <bsdtypes.h>
877: #endif
2.17 luotonen 878:
2.88 frystyk 879: /* stdefs.h */
880: #ifdef HAVE_STDEFS_H
881: #include <stdefs.h>
2.15 luotonen 882: #endif
883:
2.88 frystyk 884: /* bsdtime.h */
885: #ifdef HAVE_BSDTIME_H
886: #include <bsdtime.h>
2.15 luotonen 887: #endif
2.36 frystyk 888:
2.88 frystyk 889: /* select.h */
890: #ifdef HAVE_SYS_SELECT_H
891: #include <sys/select.h>
892: #else
893: #ifdef HAVE_SELECT_H
894: #include <select.h>
2.36 frystyk 895: #endif
2.88 frystyk 896: #endif
2.51 frystyk 897:
2.88 frystyk 898: /* dnetdb.h */
899: #ifdef HAVE_DNETDB_H
900: #include <dnetdb.h>
901: #endif
2.25 luotonen 902:
2.88 frystyk 903: /* ucx$inetdef.h */
904: #ifdef HAVE_UCX_INETDEF_H
905: #include <ucx$inetdef.h>
906: #endif
2.26 frystyk 907:
2.88 frystyk 908: /* libc.h */
909: #ifdef HAVE_LIBC_H
910: #include <libc.h>
911: #endif
2.32 frystyk 912:
2.88 frystyk 913: /* stdlib.h */
914: #ifdef HAVE_STDLIB_H
915: #include <stdlib.h>
916: #endif
2.32 frystyk 917:
2.88 frystyk 918: /* malloc.h */
919: #ifdef HAVE_MALLOC_H
920: #include <malloc.h>
2.58 frystyk 921: #endif
922:
2.88 frystyk 923: /* memory.h */
924: #ifdef HAVE_MEMORY_H
925: #include <memory.h>
926: #endif
2.58 frystyk 927:
2.88 frystyk 928: /* unixlib.h */
929: #ifdef HAVE_UNIXLIB_H
930: #include <unixlib.h>
931: #endif
2.58 frystyk 932:
2.88 frystyk 933: /* ctype.h */
934: #ifdef HAVE_CTYPE_H
935: #include <ctype.h>
2.32 frystyk 936: #endif
937:
2.88 frystyk 938: /* curses.h */
939: #ifdef CURSES
940: #ifdef HAVE_CURSESX_H
941: #include <cursesX.h>
942: #else
943: #ifdef HAVE_CURSES_H
944: #include <curses.h>
945: #endif
946: #endif
2.62 frystyk 947: #endif
948:
2.88 frystyk 949: /* resource.h (some wait.h's require it) */
950: #ifdef HAVE_SYS_RESOURCE_H
951: #include <sys/resource.h>
952: #else
953: #ifdef HAVE_RESOURCE_H
954: #include <resource.h>
2.45 frystyk 955: #endif
2.81 frystyk 956: #endif
957:
2.88 frystyk 958: /* dirent.h / ndir.h / dir.h */
959: #ifdef HAVE_DIRENT_H
2.32 frystyk 960: #include <dirent.h>
2.88 frystyk 961: #define NAMLEN(dirent) strlen((dirent)->d_name)
2.26 frystyk 962: #else
2.88 frystyk 963: #define dirent direct
964: #define NAMLEN(dirent) (dirent)->d_namlen
965: #ifdef HAVE_SYS_NDIR_H
966: #include <sys/ndir.h>
967: #endif
968: #ifdef HAVE_SYS_DIR_H
2.32 frystyk 969: #include <sys/dir.h>
2.88 frystyk 970: #endif
971: #ifdef HAVE_DIR_H
972: #include <dir.h>
973: #endif
974: #ifdef HAVE_NDIR_H
975: #include <ndir.h>
976: #endif
2.26 frystyk 977: #endif
978:
2.90 eric 979: #if !defined(HAVE_STRCHR) && !defined(WWW_MSWINDOWS)
2.88 frystyk 980: #define strchr index
981: #define strrchr rindex
2.26 frystyk 982: #endif
2.90 eric 983: #if !defined(HAVE_MEMCPY) && !defined(WWW_MSWINDOWS)
2.88 frystyk 984: #define memcpy(d, s, n) bcopy((s), (d), (n))
985: #define memmove(d, s, n) bcopy((s), (d), (n))
2.25 luotonen 986: #endif
2.37 frystyk 987:
2.88 frystyk 988: /* Standard headers */
989: #ifdef STDC_HEADERS
990: #include <stdarg.h>
991: #else
2.90 eric 992: #ifndef WWW_MSWINDOWS
2.88 frystyk 993: #include <varargs.h>
2.90 eric 994: #endif
2.88 frystyk 995: #endif
2.26 frystyk 996:
2.88 frystyk 997: /* wait.h */
998: #ifdef HAVE_SYS_WAIT_H
999: #include <sys/wait.h>
1000: #endif
1001: #ifndef WEXITSTATUS
1002: #define WEXITSTATUS(stat_val) (((unsigned)(stat_val) >> 8) & 255)
1003: #endif
1004: #ifndef WIFEXITED
1005: #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1006: #endif
2.92 eric 1007: </PRE>
1008:
1009: <H2>Booleans</H2>
1010:
1011: <PRE>
1012: #if !defined(BOOLEAN)
1013: typedef char BOOLEAN; /* Logical value */
1014: #endif
1015:
1016: #ifndef CURSES
1017: #ifndef TRUE
1018: #define TRUE (BOOLEAN)1
1019: #define FALSE (BOOLEAN)0
1020: #endif
1021: #endif /* CURSES */
1022:
1023: #if !defined(BOOL) && !defined(WWW_MSWINDOWS)
1024: #define BOOL BOOLEAN
1025: #endif
1026:
1027: #ifndef YES
1028: #define YES (BOOL)1
1029: #define NO (BOOL)0
1030: #endif
1031: </PRE>
1032:
1033: <H2>NULL Definition</H2>
1034:
1035: <PRE>
1036: #ifndef NULL
1037: #define NULL ((void *)0)
1038: #endif
2.88 frystyk 1039: </pre>
2.39 frystyk 1040:
2.88 frystyk 1041: <H2>Sleep System Call</H2>
2.39 frystyk 1042:
1043: Some systems use milliseconds instead of seconds
1044:
1045: <PRE>
1046: #ifndef SLEEP
1047: #define SLEEP(n) sleep(n)
1048: #endif
1049: </PRE>
2.13 luotonen 1050:
2.88 frystyk 1051: <H2>SOCKS</H2>
2.37 frystyk 1052:
2.88 frystyk 1053: SOCKS is a package for allowing socket connections to tunnel through
1054: firewalls in carefully controlled situations. This package can be
1055: optionally compiled with SOCKS support; these definitions replace the
1056: normal socket calls with the SOCKS ones. Initial modification of the
1057: library is credited to Ian Dunkin <imd1707@ggr.co.uk>.</P>
1058:
2.37 frystyk 1059: <PRE>
2.88 frystyk 1060: #ifdef SOCKS
2.37 frystyk 1061: #define connect Rconnect
1062: #define accept Raccept
1063: #define getsockname Rgetsockname
1064: #define bind Rbind
1065: #define listen Rlisten
1066: #endif
1067: </PRE>
1068:
2.88 frystyk 1069: <H2>Network Family</H2>
2.37 frystyk 1070:
1071: <PRE>
1072: #ifdef DECNET
1073: typedef struct sockaddr_dn SockA; /* See netdnet/dn.h or custom vms.h */
1074: #else /* Internet */
1075: typedef struct sockaddr_in SockA; /* See netinet/in.h */
1076: #endif
1077: </PRE>
1078:
2.88 frystyk 1079: <H2>Default Values of Network Access</H2>
2.37 frystyk 1080:
1081: <PRE>
1082: #ifndef NETCLOSE
1083: #define NETCLOSE close /* Routine to close a TCP-IP socket */
1084: #endif
1085:
1086: #ifndef NETREAD
1087: #define NETREAD read /* Routine to read from a TCP-IP socket */
1088: #endif
1089:
1090: #ifndef NETWRITE
1091: #define NETWRITE write /* Routine to write to a TCP-IP socket */
1092: #endif
1093: </PRE>
1094:
2.88 frystyk 1095: <H2>Definition of errno and Return Code</H2>
2.37 frystyk 1096:
2.41 frystyk 1097: This is the definition of error codes and the corresponding string
1098: constants. If we do not have the <CODE>strerror</CODE> function then
1099: try the error list table.
1100:
2.37 frystyk 1101: <PRE>
1102: #ifndef ERRNO_DONE
1103: extern int errno;
1104: #define socerrno errno
1105: #endif
2.41 frystyk 1106:
1107: #ifndef HAVE_STRERROR /* Otherwise use the table */
1108: extern char *sys_errlist[];
1109: extern int sys_nerr;
1110: #endif
2.37 frystyk 1111: </PRE>
1112:
2.88 frystyk 1113: <H2>Definition of Socket Desrciptores</H2>
2.19 luotonen 1114:
2.37 frystyk 1115: This is necessary in order to support Windows NT...
2.19 luotonen 1116:
2.37 frystyk 1117: <PRE>
2.79 frystyk 1118: #ifndef SOCKET
1119: #define SOCKET int /* Unix like socket descriptor */
1120: #define INVSOC (-1) /* Unix invalid socket */
2.37 frystyk 1121: #endif
2.79 frystyk 1122:
1123: #ifdef __svr4__
1124: #define HT_BACKLOG 32 /* Number of pending connect requests (TCP) */
1125: #else
1126: #define HT_BACKLOG 5 /* Number of pending connect requests (TCP) */
1127: #endif /* __svr4__ */
2.26 frystyk 1128: </PRE>
2.59 frystyk 1129:
2.88 frystyk 1130: <H2>Additional Network variables for SOCKET, file access bits</H2>
2.59 frystyk 1131:
1132: <PRE>
2.66 frystyk 1133: #ifndef _WINSOCKAPI_
2.59 frystyk 1134: #define FD_READ 0x01
1135: #define FD_WRITE 0x02
1136: #define FD_OOB 0x04
1137: #define FD_ACCEPT 0x08
1138: #define FD_CONNECT 0x10
1139: #define FD_CLOSE 0x20
1140: #endif /* _WINSOCKAPI_ */
1141: </PRE>
2.1 timbl 1142:
2.88 frystyk 1143: <H2>Rough estimate of max path length</H2>
2.37 frystyk 1144:
2.26 frystyk 1145: <PRE>
1146: #ifndef HT_MAX_PATH
1147: #ifdef MAXPATHLEN
1148: #define HT_MAX_PATH MAXPATHLEN
1149: #else
1150: #ifdef PATH_MAX
1151: #define HT_MAX_PATH PATH_MAX
1152: #else
1153: #define HT_MAX_PATH 1024 /* Any better ideas? */
1154: #endif
1155: #endif
1156: #endif /* HT_MAX_PATH */
1157: </PRE>
2.1 timbl 1158:
2.88 frystyk 1159: <H2>Definition of NGROUPS</H2>
2.26 frystyk 1160:
1161: <PRE>
2.94 ! frystyk 1162: #ifdef GETGROUPS_T
2.26 frystyk 1163: #ifndef NGROUPS
1164: #ifdef NGROUPS_MAX
2.94 ! frystyk 1165: #define NGROUPS NGROUPS_MAX
2.26 frystyk 1166: #else
2.94 ! frystyk 1167: #define NGROUPS 20 /* Any better ideas? */
2.26 frystyk 1168: #endif
2.37 frystyk 1169: #endif
2.34 frystyk 1170: #endif
1171: </PRE>
1172:
2.88 frystyk 1173: <H2>Definition of Max Domain Name Length</H2>
2.29 frystyk 1174: <PRE>
1175: #ifndef MAXHOSTNAMELEN
1176: #define MAXHOSTNAMELEN 64 /* Any better ideas? */
1177: #endif
1178: </PRE>
1179:
2.88 frystyk 1180: <H2>File/Directory Management</H2>
2.41 frystyk 1181: <PRE>
1182: #ifndef MKDIR
1183: #define MKDIR(a,b) mkdir((a), (b))
1184: #endif
1185:
2.56 frystyk 1186: #ifndef RMDIR
1187: #define RMDIR(a) rmdir((a))
1188: #endif
1189:
1190: #ifndef REMOVE
1191: #define REMOVE(a) unlink((a))
2.47 frystyk 1192: #endif
1193:
1194: #ifndef DEFAULT_SUFFIXES
1195: #define DEFAULT_SUFFIXES ".,_"
2.41 frystyk 1196: #endif
1197: </PRE>
1198:
2.88 frystyk 1199: <H2>Macros for manipulating masks for select()</H2>
1200:
2.26 frystyk 1201: <PRE>
2.1 timbl 1202: #ifndef FD_SET
2.88 frystyk 1203: #define FD_SET(fd, m) (*(unsigned*)(m) |= (1 << (fd)))
1204: #endif
1205:
1206: #ifndef FD_CLR
1207: #define FD_CLR(fd, m) (*(unsigned*)(m) &= ~(1 << (fd)))
1208: #endif
1209:
1210: #ifndef FD_ZERO
1211: #define FD_ZERO(m) (*(unsigned*)(m)) = 0
1212: #endif
1213:
1214: #ifndef FD_ISSET
1215: #define FD_ISSET(fd, m) (*(unsigned*)(m) & (1 << (fd)))
1216: #endif
2.26 frystyk 1217: </PRE>
1218:
2.88 frystyk 1219: <H2>Macros for converting characters</H2>
2.1 timbl 1220:
2.26 frystyk 1221: <PRE>
1222: #ifndef TOASCII
2.1 timbl 1223: #define TOASCII(c) (c)
1224: #define FROMASCII(c) (c)
2.5 timbl 1225: #endif
2.26 frystyk 1226: </PRE>
1227:
2.88 frystyk 1228: <H2>Cache file prefix</H2>
2.5 timbl 1229:
2.26 frystyk 1230: This is something onto which we tag something meaningful to make a cache
2.88 frystyk 1231: file name. used in HTWSRC.c at least. If it is not defined at all, caching
2.5 timbl 1232: is turned off.
2.26 frystyk 1233:
1234: <PRE>
1235: #ifndef CACHE_FILE_PREFIX
2.88 frystyk 1236: #ifdef unix
2.6 timbl 1237: #define CACHE_FILE_PREFIX "/usr/wsrc/"
2.5 timbl 1238: #endif
2.60 frystyk 1239: #endif
1240: </PRE>
1241:
2.88 frystyk 1242: <H2>Thread Safe Setup</H2>
2.60 frystyk 1243:
1244: These are some constants setting the size of buffers used by thread
1245: safe versions of some system calls.
1246:
1247: <PRE>
1248: #ifdef HT_REENTRANT
1249: #define HOSTENT_MAX 128
1250: #define CTIME_MAX 26
2.1 timbl 1251: #endif
2.17 luotonen 1252: </PRE>
1253:
1254: <PRE>
1255: #endif
1256: </PRE>
2.94 ! frystyk 1257:
! 1258: <HR>
! 1259: <ADDRESS>
! 1260: @(#) $Id: Date Author State $
! 1261: </ADDRESS>
2.26 frystyk 1262: </BODY>
2.7 timbl 1263: </HTML>
Webmaster