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