Annotation of libwww/Library/src/wwwsys.html, revision 2.75
2.7 timbl 1: <HTML>
2: <HEAD>
2.2 timbl 3: <TITLE>System dependencies in the W3 library</TITLE>
2.75 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 1-Oct-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:
315: #ifdef _WINDLL
316: #define NO_STDIO /* If we are making a DLL */
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: <PRE>
442:
2.4 timbl 443: #endif /* WINDOWS */
2.26 frystyk 444: </PRE>
2.2 timbl 445:
2.38 frystyk 446: <H2>Windows NT (32 bit)</H2>
447:
448: Some special things for the 32 bit version...
449:
450: <PRE>
451: #ifdef WIN32
452: #define EWOULDBLOCK WSAEWOULDBLOCK
453: #define EINPROGRESS WSAEINPROGRESS
454: #define ECONNREFUSED WSAECONNREFUSED
455: #define ETIMEDOUT WSAETIMEDOUT
456: #define ENETUNREACH WSAENETUNREACH
457: #define EHOSTUNREACH WSAEHOSTUNREACH
458: #define EHOSTDOWN WSAEHOSTDOWN
459: #define EISCONN WSAEISCONN
2.39 frystyk 460:
2.48 frystyk 461: #undef NETREAD
462: #undef NETWRITE
2.41 frystyk 463:
464: #define NETREAD(s,b,l) ((s) >= 10) ? recv((s),(b),(l),0) : read((s), (b), (l))
2.48 frystyk 465: #define NETWRITE(s,b,l) ((s) >= 10) ? send((s),(b),(l),0) : write((s), (b), (l))
466:
2.59 frystyk 467: /* #undef NO_UNIX_IO */ /* CLB NT has some Unix IO - must be more specific */
2.48 frystyk 468:
469: /* Some compilers do only define WIN32 and NOT _WINDOWS */
470: #undef MKDIR
471: #define MKDIR(a,b) mkdir((a)) /* CLB NT has mkdir, but only one arg */
2.41 frystyk 472:
473: #define NO_GROUPS
2.50 frystyk 474: #define NO_ALTZONE
2.48 frystyk 475: #define SLEEP(n) Sleep((n)*1000)
2.50 frystyk 476: #endif /* WIN32 */
2.38 frystyk 477: </PRE>
478:
2.26 frystyk 479: <H2>VAX/VMS</H2>
2.38 frystyk 480:
2.26 frystyk 481: Under VMS, there are many versions of TCP-IP. Define one if you do not
2.4 timbl 482: use Digital's UCX product:
2.38 frystyk 483:
2.4 timbl 484: <DL>
485: <DT>UCX
2.5 timbl 486: <DD> DEC's "Ultrix connection" (default)
2.4 timbl 487: <DT>WIN_TCP
2.5 timbl 488: <DD> From Wollongong, now GEC
489: software.
2.4 timbl 490: <DT>MULTINET
2.5 timbl 491: <DD> From SRI, now from TGV Inv.
2.4 timbl 492: <DT>DECNET
2.5 timbl 493: <DD> Cern's TCP socket emulation
2.4 timbl 494: over DECnet
495: </DL>
2.37 frystyk 496:
497: The last three do not interfere with the unix i/o library, and so they
498: need special calls to read, write and close sockets. In these cases
499: the socket number is a VMS channel number, so we make the @@@ HORRIBLE
500: @@@ assumption that a channel number will be greater than 10 but a
501: unix file descriptor less than 10. It works.
2.26 frystyk 502:
503: <PRE>
504: #ifdef VMS
2.47 frystyk 505: #define CACHE_FILE_PREFIX "SYS$LOGIN:Z_"
506: #define DEFAULT_SUFFIXES "._"
2.7 timbl 507:
508: #ifdef WIN_TCP
2.32 frystyk 509: #define NETREAD(s,b,l) ((s)>10 ? netread((s),(b),(l)) : read((s),(b),(l)))
510: #define NETWRITE(s,b,l) ((s)>10 ? netwrite((s),(b),(l)) : write((s),(b),(l)))
511: #define NETCLOSE(s) ((s)>10 ? netclose(s) : close(s))
2.16 duns 512: #endif /* WIN_TCP */
2.1 timbl 513:
514: #ifdef MULTINET
515: #undef NETCLOSE
516: #undef NETREAD
517: #undef NETWRITE
2.32 frystyk 518: #define NETREAD(s,b,l) ((s)>10 ? socket_read((s),(b),(l)) : read((s),(b),(l)))
519: #define NETWRITE(s,b,l) ((s)>10 ? socket_write((s),(b),(l)) : \
2.1 timbl 520: write((s),(b),(l)))
2.32 frystyk 521: #define NETCLOSE(s) ((s)>10 ? socket_close(s) : close(s))
2.37 frystyk 522: #define IOCTL(s,c,a) socket_ioctl(s,c,a);
2.16 duns 523: #endif /* MULTINET */
2.1 timbl 524:
525: #ifdef DECNET
2.74 frystyk 526: #define DNP_OBJ 80 /* This one doesn't look busy, but we must check */
527: /* That one was for decnet */
528: #undef SELECT /* not supported */
2.32 frystyk 529: #define NETREAD(s,b,l) ((s)>10 ? recv((s),(b),(l),0) : read((s),(b),(l)))
530: #define NETWRITE(s,b,l) ((s)>10 ? send((s),(b),(l),0) : write((s),(b),(l)))
531: #define NETCLOSE(s) ((s)>10 ? socket_close(s) : close(s))
2.73 frystyk 532:
533: #define NO_GETHOSTNAME /* Decnet doesn't have a name server */
2.1 timbl 534: #endif /* Decnet */
2.73 frystyk 535:
536: #define NO_RESOLV_CONF
537: #define NO_GETDOMAINNAME
2.31 duns 538:
2.1 timbl 539: /* Certainly this works for UCX and Multinet; not tried for Wollongong
540: */
541: #ifdef MULTINET
2.32 frystyk 542: #include <time.h>
2.16 duns 543: #ifdef __TIME_T
544: #define __TYPES
545: #define __TYPES_LOADED
546: #endif /* __TIME_T */
2.37 frystyk 547: #include <multinet_root:[multinet.include.sys]types.h>
548: #include <multinet_root:[multinet.include]errno.h>
2.16 duns 549: #ifdef __TYPES
550: #define __TIME_T
551: #endif /* __TYPE */
552: #ifdef __TIME_LOADED
553: #define __TIME
554: #endif /* __TIME_LOADED */
2.37 frystyk 555: #include <multinet_root:[multinet.include.sys]time.h>
2.16 duns 556: #else /* not MULTINET */
2.32 frystyk 557: #include <types.h>
558: #include <errno.h>
559: #include <time.h>
2.16 duns 560: #endif /* not MULTINET */
2.1 timbl 561:
562: #include string
563:
564: #ifndef STDIO_H
2.24 luotonen 565: #include <stdio>
2.1 timbl 566: #define STDIO_H
567: #endif
568:
569: #include file
570:
2.37 frystyk 571: #ifndef DECNET /* Why is it used at all ? Types conflict with "types.h> */
2.1 timbl 572: #include unixio
573: #endif
574:
575: #define INCLUDES_DONE
576:
577: #ifdef MULTINET /* Include from standard Multinet directories */
2.37 frystyk 578: #include <multinet_root:[multinet.include.sys]socket.h>
2.1 timbl 579: #ifdef __TIME_LOADED /* defined by sys$library:time.h */
580: #define __TIME /* to avoid double definitions in next file */
581: #endif
2.37 frystyk 582: #include <multinet_root:[multinet.include.netinet]in.h>
583: #include <multinet_root:[multinet.include.arpa]inet.h>
584: #include <multinet_root:[multinet.include]netdb.h>
585: #include <multinet_root:[multinet.include.sys]ioctl.h>
2.1 timbl 586:
587: #else /* not multinet */
588: #ifdef DECNET
2.37 frystyk 589: #include <types.h> /* for socket.h */
590: #include <socket.h>
2.65 frystyk 591: #include <dn>
592: #include <dnetdb>
2.1 timbl 593:
594: #else /* UCX or WIN */
2.16 duns 595: #ifdef CADDR_T
596: #define __CADDR_T
597: #endif /* problem with xlib.h inclusion */
2.32 frystyk 598: #include <socket.h>
599: #include <in.h>
600: #include <inet.h>
601: #include <netdb.h>
602: #include <ucx$inetdef.h>
2.1 timbl 603:
604: #endif /* not DECNET */
605: #endif /* of Multinet or other TCP includes */
606:
607: #define TCP_INCLUDES_DONE
2.63 frystyk 608:
609: #ifdef UCX
610: #define SIMPLE_TELNET
611: #endif
2.26 frystyk 612: </PRE>
2.1 timbl 613:
2.31 duns 614: On VMS directory browsing is available through a separate
615: copy of dirent.c. The definition of R_OK seem to be missing
616: from the system include files...
617:
618: <PRE>
619: #define USE_DIRENT
2.37 frystyk 620: #define GOT_READ_DIR
621: #include <dirent.h>
2.31 duns 622: #define STRUCT_DIRENT struct dirent
623: #define R_OK 4
624: </PRE>
625:
2.37 frystyk 626: On VMS machines, the linker needs to be told to put global data
627: sections into a data segment using these storage
2.7 timbl 628: classes. (MarkDonszelmann)
2.26 frystyk 629:
630: <PRE>
631: #ifdef VAXC
2.7 timbl 632: #define GLOBALDEF globaldef
633: #define GLOBALREF globalref
634: #endif /* VAXC */
2.1 timbl 635: #endif /* vms */
2.26 frystyk 636: </PRE>
2.1 timbl 637:
2.26 frystyk 638: On non-VMS machines, the GLOBALDEF and GLOBALREF storage types default
2.7 timbl 639: to normal C storage types.
2.26 frystyk 640:
641: <PRE>
642: #ifndef GLOBALREF
2.7 timbl 643: #define GLOBALDEF
644: #define GLOBALREF extern
645: #endif
2.31 duns 646: </PRE>
647:
2.66 frystyk 648: On non-VMS machines STAT should be stat...On VMS machines
649: STAT is a function that converts directories and devices so that you
2.31 duns 650: can stat them.
651:
652: <PRE>
653: #ifdef VMS
2.37 frystyk 654: typedef unsigned long mode_t;
2.69 frystyk 655: #define HT_STAT HTStat
656: #define HT_LSTAT HTStat
657: #else
658: #define HT_STAT stat
659: #define HT_LSTAT lstat
2.31 duns 660: #endif /* non VMS */
2.26 frystyk 661: </PRE>
2.7 timbl 662:
2.41 frystyk 663: <H3>Strftime and other time stuff</H3>
664:
665: <PRE>
666: #ifdef VMS
667: #ifndef DECC
668: #define NO_STRFTIME
669: #endif
670: #define NO_MKTIME
671: #define NO_TIMEGM
672: #define NO_GMTOFF
673: #define NO_TIMEZONE
674: #endif
675: </PRE>
676:
2.37 frystyk 677: <H3>Definition of Errno</H3>
678:
679: <PRE>
680: #ifdef VMS
681: #ifndef __DECC
682: extern int uerrno; /* Deposit of error info (as per errno.h) */
683: extern volatile noshare int socket_errno; /* socket VMS error info
684: (used for translation of vmserrno) */
685: extern volatile noshare int vmserrno; /* Deposit of VMS error info */
686: extern volatile noshare int errno; /* noshare to avoid PSECT conflict */
687: #define ERRNO_DONE
688: #endif /* not DECC */
689: #endif /* VMS */
690: </PRE>
691:
2.26 frystyk 692: <H2>SCO ODT unix version</H2>
2.1 timbl 693:
2.32 frystyk 694: (by Brian King)
695:
2.2 timbl 696: <PRE>
697: #ifdef sco
2.32 frystyk 698: #include <grp.h>
699: #include <unistd.h>
700: #include <sys/fcntl.h>
701: #include <time.h>
2.2 timbl 702: #define USE_DIRENT
2.32 frystyk 703: #define NEED_INITGROUPS
2.37 frystyk 704: #define NO_GETDOMAINNAME
2.1 timbl 705: #endif
2.26 frystyk 706: </PRE>
2.1 timbl 707:
2.40 frystyk 708: <H2>BSDi BSD/386 Unix</H2>
709:
710: Specific stuff for BSDi BSD/386
711:
712: <PRE>
713: #ifdef bsdi
714: #define NO_GETDOMAINNAME
715: #endif
716: </PRE>
717:
2.2 timbl 718: <H2>MIPS unix</H2>
2.26 frystyk 719: Mips hack (bsd4.3/sysV mixture...)
2.1 timbl 720:
2.26 frystyk 721: <PRE>
2.25 luotonen 722: #ifdef Mips /* Bruker */
723: typedef mode_t int;
724: #define S_ENFMT S_ISGID /* record locking enforcement flag */
2.37 frystyk 725: #define S_ISCHR(m) ((m) & S_IFCHR)
726: #define S_ISBLK(m) ((m) & S_IFBLK)
727: #define S_ISDIR(m) (((m)& S_IFMT) == S_IFDIR)
728: #define S_ISREG(m) (((m)& S_IFMT) == S_IFREG)
2.32 frystyk 729: #define WEXITSTATUS(s) (((s).w_status >> 8) & 0377)
730: #define NO_STRFTIME
2.41 frystyk 731:
732: /* Mips can't uppercase non-alpha */
733: #define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
734: #define TOUPPER(c) (islower(c) ? toupper(c) : (c))
2.26 frystyk 735: </PRE>
736:
737: <H3>File Permissions</H3>
2.1 timbl 738:
2.26 frystyk 739: <PRE>
740: #ifndef S_IRWXU
741: #define S_IRWXU 0000700
742: #define S_IRWXG 0000070
743: #define S_IRWXO 0000007
744: #define S_IRUSR 0000400
745: #define S_IWUSR 0000200
746: #define S_IXUSR 0000100
747: #define S_IRGRP 0000040
748: #define S_IWGRP 0000020
749: #define S_IXGRP 0000010
750: #define S_IROTH 0000004
751: #define S_IWOTH 0000002
752: #define S_IXOTH 0000001
753: #endif /* S_IRWXU */
754: #endif /* Mips */
2.8 timbl 755: </PRE>
2.26 frystyk 756:
2.74 frystyk 757: <H2>Linux</H2>
758:
759: Linux support (thanks to Rainer Klute)
760:
761: <PRE>
762: #ifdef linux
763: #include <unistd.h>
764: #include <limits.h>
765: #include <sys/fcntl.h>
766:
767: #define NO_ALTZONE
768: #define NO_GETWD
769: #define HAS_GETCWD
770: #define FULL_TELNET
771: #endif /* linux */
772: </PRE>
773:
2.10 luotonen 774: <H2>Solaris</H2>
2.32 frystyk 775:
2.74 frystyk 776: Solaris and other SVR4 based systems
2.32 frystyk 777:
2.10 luotonen 778: <PRE>
2.71 frystyk 779: #if defined(__svr4__) || defined(_POSIX_SOURCE) || defined(__hpux) || defined(__sgi)
2.32 frystyk 780:
2.74 frystyk 781: #if defined(__hpux)
2.42 frystyk 782: #define NO_ALTZONE
783: #endif
2.41 frystyk 784:
2.32 frystyk 785: #ifdef UTS4 /* UTS wants sys/types.h first */
786: #include <sys/types.h>
787: #endif
788:
2.28 luotonen 789: #include <unistd.h>
2.32 frystyk 790:
791: #ifdef UTS4
792: #include <sys/fcntl.h>
793: #define POSIXWAIT
794: #endif
795:
796: #ifdef AIX /* Apple Unix */
2.28 luotonen 797: #include <fcntl.h>
798: #else
799: #include <sys/fcntl.h>
800: #endif
801: </PRE>
802:
2.32 frystyk 803: This is for NCR 3000 and Pyramid that also are SVR4 systems. Thanks to
804: <EM>Alex Podlecki, <a.podlecki@att.com></EM>
805:
2.28 luotonen 806: <PRE>
2.32 frystyk 807: #ifndef NGROUPS_MAX
808: #include <limits.h>
809: #endif
2.41 frystyk 810:
811: /* Pyramid and Mips can't uppercase non-alpha */
812: #ifdef pyramid
813: #define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
814: #define TOUPPER(c) (islower(c) ? toupper(c) : (c))
815: #endif
816:
2.37 frystyk 817: </PRE>
818:
819: <CODE>getwd()</CODE> is BSD. System V has <CODE>getcwd()</CODE>
820:
821: <PRE>
822: #define NO_GETWD
823: #define HAS_GETCWD
2.32 frystyk 824:
2.33 frystyk 825: #endif /* Solaris and SVR4 */
2.32 frystyk 826: </PRE>
2.28 luotonen 827:
2.32 frystyk 828: <H2>UTS 2.1 (BSD-like)</H2>
829: <PRE>
830: #ifdef UTS2
2.28 luotonen 831: #include <time.h>
2.32 frystyk 832: #include <fcntl.h>
2.28 luotonen 833:
2.41 frystyk 834: #ifndef R_OK
835: #define R_OK 4
836: #endif
2.32 frystyk 837: #define NO_STRFTIME
838: #define WEXITSTATUS(x) ((int)((x).w_T.w_Retcode))
2.28 luotonen 839:
2.32 frystyk 840: #undef POSIXWAIT
841: #endif /* UTS2 */
2.10 luotonen 842: </PRE>
2.28 luotonen 843:
2.8 timbl 844: <H2>OSF/1</H2>
2.44 frystyk 845:
2.26 frystyk 846: <PRE>
847: #ifdef __osf__
2.8 timbl 848: #define USE_DIRENT
2.44 frystyk 849: #define NO_TIMEZONE /* OSF/1 has gmtoff */
2.8 timbl 850: #endif /* OSF1 AXP */
2.43 frystyk 851: </PRE>
852:
853: <H2>Ultrix Decstation</H2>
854:
855: <PRE>
856: #ifdef decstation
2.69 frystyk 857: #include <unistd.h>
2.43 frystyk 858: #define NO_TIMEZONE /* Ultrix has gmtoff */
2.63 frystyk 859: #define RLOGIN_USER
2.43 frystyk 860: #endif
2.21 frystyk 861: </PRE>
862:
2.22 luotonen 863: <H2>ISC 3.0</H2>
864: by Lauren Weinstein <lauren@vortex.com>.
865: <PRE>
866:
2.30 luotonen 867: #ifdef ISC3 /* Lauren */
868: #define USE_DIRENT
2.37 frystyk 869: #define GOT_READ_DIR
2.30 luotonen 870: #include <sys/ipc.h>
871: #include <sys/dirent.h>
872: #define direct dirent
873: #include <sys/unistd.h>
874: #define d_namlen d_reclen
875: #include <sys/limits.h>
2.37 frystyk 876: typedef int mode_t;
2.41 frystyk 877:
2.30 luotonen 878: #define SIGSTP
2.41 frystyk 879:
2.30 luotonen 880: #define POSIXWAIT
2.37 frystyk 881: #define _POSIX_SOURCE
2.41 frystyk 882:
2.30 luotonen 883: #include <sys/types.h>
884: #include <sys/wait.h>
885: #include <net/errno.h>
2.22 luotonen 886:
2.30 luotonen 887: #define _SYSV3
888: #include <time.h>
2.22 luotonen 889:
2.25 luotonen 890: #include <sys/fcntl.h>
2.22 luotonen 891: #define S_ISDIR(m) (((m) & 0170000) == 0040000)
892: #define S_ISCHR(m) (((m) & 0170000) == 0020000)
893: #define S_ISBLK(m) (((m) & 0170000) == 0060000)
894: #define S_ISREG(m) (((m) & 0170000) == 0100000)
895: #define S_ISFIFO(m) (((m) & 0170000) == 0010000)
896: #define S_ISLNK(m) (((m) & 0170000) == 0120000)
897: #endif /* ISC 3.0 */
2.21 frystyk 898: </PRE>
899:
2.13 luotonen 900: <H2>NeXT</H2>
2.41 frystyk 901:
902: Next has a lot of strange changes in constants...
903:
2.13 luotonen 904: <PRE>
905: #ifdef NeXT
2.37 frystyk 906: #include <sys/types.h>
907: #include <sys/stat.h>
2.15 luotonen 908:
2.17 luotonen 909: typedef unsigned short mode_t;
910:
2.15 luotonen 911: #ifndef S_ISDIR
912: #define S_ISDIR(m) (m & S_IFDIR)
913: #define S_ISREG(m) (m & S_IFREG)
914: #define S_ISCHR(m) (m & S_IFCHR)
915: #define S_ISBLK(m) (m & S_IFBLK)
916: #define S_ISLNK(m) (m & S_IFLNK)
917: #define S_ISSOCK(m) (m & S_IFSOCK)
918: #define S_ISFIFO(m) (NO)
919: #endif
920:
921: #ifndef WEXITSTATUS
922: #define WEXITSTATUS(s) (((s).w_status >> 8) & 0377)
923: #endif
2.36 frystyk 924:
925: #ifndef O_NONBLOCK
926: #define O_NONBLOCK O_NDELAY
927: #endif
2.51 frystyk 928:
929: #define NO_TIMEZONE /* next has gmtoff */
2.25 luotonen 930: </PRE>
931:
2.26 frystyk 932: <H3>File Permissions for NeXT</H3>
2.25 luotonen 933: <PRE>
2.15 luotonen 934: #ifndef S_IRWXU
935: #define S_IRWXU 0000700
936: #define S_IRWXG 0000070
937: #define S_IRWXO 0000007
2.17 luotonen 938: #define S_IRUSR 0000400
939: #define S_IWUSR 0000200
940: #define S_IXUSR 0000100
941: #define S_IRGRP 0000040
942: #define S_IWGRP 0000020
943: #define S_IXGRP 0000010
944: #define S_IROTH 0000004
945: #define S_IWOTH 0000002
946: #define S_IXOTH 0000001
2.26 frystyk 947: #endif /* S_IRWXU */
948: #endif /* NeXT */
949: </PRE>
950:
2.32 frystyk 951: <H2>A/UX Apple UNIX</H2>
952:
953: <ADDRESS>Kelly King, bhutab@apple.com and Jim Jagielski,
954: jim@jagubox.gsfc.nasa.gov</ADDRESS>
955:
956: <PRE>
957: #ifdef _AUX
958: #include <time.h>
959: #define WEXITSTATUS(s) (((s).w_status >> 8) & 0377)
2.41 frystyk 960: #define NO_STRFTIME
2.58 frystyk 961: #endif
962: </PRE>
963:
964: <H2>Sony News</H2>
965:
966: Thanks to Isao SEKI, seki@tama.prug.or.jp
967:
968: <PRE>
969: #ifdef sony_news
970: #include <sys/wait.h>
971: #define WEXITSTATUS(s) (((s).w_status >> 8) & 0377)
972: typedef int mode_t;
2.32 frystyk 973: #endif
974: </PRE>
975:
2.26 frystyk 976: <H2><A NAME="z10">Regular BSD unix versions</H2>
977:
978: These are a default unix where not already defined specifically.
979:
980: <PRE>
981: #ifndef INCLUDES_DONE
982:
2.32 frystyk 983: #include <sys/types.h>
984: #include <string.h>
985:
986: #include <errno.h> /* independent */
987: #include <sys/time.h> /* independent */
988: #include <sys/stat.h>
989: #include <sys/param.h>
990: #include <sys/file.h> /* For open() etc */
2.26 frystyk 991: #define INCLUDES_DONE
992: #endif /* Normal includes */
2.45 frystyk 993:
994: #ifdef SUNOS
2.71 frystyk 995: #include <unistd.h>
2.45 frystyk 996: #define NO_TIMEZONE
997: #define NO_MKTIME
2.46 frystyk 998: #undef HAVE_STRERROR
2.62 frystyk 999: #endif
1000:
1001: #ifdef NetBSD
1002: #define NO_TIMEZONE
1003: #define HAVE_STRERROR
2.45 frystyk 1004: #endif
1005:
2.26 frystyk 1006: </PRE>
1007:
1008: <H3>Directory reading stuff - BSD or SYS V</H3>
1009: <PRE>
2.54 frystyk 1010: #if defined(unix) || defined(__unix__) /* If UNIX (thanks to Rainer Klute) */
2.37 frystyk 1011:
1012: #define GOT_PIPE /* We do have a pipe */
2.68 frystyk 1013: #define GOT_READ_DIR /* if directory reading functions are available */
1014: #define GOT_OWNER /* If a file has owner permissions */
2.37 frystyk 1015:
1016: #include <pwd.h>
1017: #include <grp.h>
1018:
1019: #include <stdio.h>
2.26 frystyk 1020:
2.27 frystyk 1021: #ifndef NeXT
2.26 frystyk 1022: #define USE_DIRENT /* Try this all the time, Henrik May 29 94 */
2.27 frystyk 1023: #endif
2.26 frystyk 1024: #ifdef USE_DIRENT /* sys v version */
2.32 frystyk 1025: #include <dirent.h>
2.26 frystyk 1026: #define STRUCT_DIRENT struct dirent
1027: #else
2.32 frystyk 1028: #include <sys/dir.h>
2.26 frystyk 1029: #define STRUCT_DIRENT struct direct
1030: #endif
1031:
2.45 frystyk 1032: #ifdef SOLARIS
2.32 frystyk 1033: #include <sys/fcntl.h>
1034: #include <limits.h>
2.26 frystyk 1035: #endif
1036: #ifndef FNDELAY
1037: #define FNDELAY O_NDELAY
2.25 luotonen 1038: #endif
2.37 frystyk 1039:
1040: #endif /* unix */
2.26 frystyk 1041: </PRE>
1042:
2.37 frystyk 1043: <HR>
2.26 frystyk 1044: <H1><A NAME="z2">General Stuff</A></H1>
2.15 luotonen 1045:
2.26 frystyk 1046: Information below this line is general for most platforms. <P>
1047:
1048: See also <A NAME="z3" HREF="#z1">Platform Specific Stuff</A>
2.39 frystyk 1049:
1050: <H3>Sleep System Call</H3>
1051:
1052: Some systems use milliseconds instead of seconds
1053:
1054: <PRE>
1055: #ifndef SLEEP
1056: #define SLEEP(n) sleep(n)
1057: #endif
1058: </PRE>
2.13 luotonen 1059:
2.37 frystyk 1060: <H3>SOCKS</H3>
1061:
1062: SOCKS modifications by Ian Dunkin <imd1707@ggr.co.uk>.
1063: <PRE>
1064: #if defined(SOCKS) && !defined(RULE_FILE)
1065: #define connect Rconnect
1066: #define accept Raccept
1067: #define getsockname Rgetsockname
1068: #define bind Rbind
1069: #define listen Rlisten
1070: #endif
1071: </PRE>
1072:
1073: <H3>Network Family</H3>
1074:
1075: <PRE>
1076: #ifdef DECNET
1077: typedef struct sockaddr_dn SockA; /* See netdnet/dn.h or custom vms.h */
1078: #else /* Internet */
1079: typedef struct sockaddr_in SockA; /* See netinet/in.h */
1080: #endif
1081: </PRE>
1082:
1083: <H3>Default Values of Network Access</H3>
1084:
1085: <PRE>
1086: #ifndef NETCLOSE
1087: #define NETCLOSE close /* Routine to close a TCP-IP socket */
1088: #endif
1089:
1090: #ifndef NETREAD
1091: #define NETREAD read /* Routine to read from a TCP-IP socket */
1092: #endif
1093:
1094: #ifndef NETWRITE
1095: #define NETWRITE write /* Routine to write to a TCP-IP socket */
1096: #endif
1097: </PRE>
1098:
2.2 timbl 1099: <H3>Include files for TCP</H3>
2.26 frystyk 1100: <PRE>
1101: #ifndef TCP_INCLUDES_DONE
2.32 frystyk 1102: #include <sys/socket.h>
1103: #include <netinet/in.h>
2.37 frystyk 1104: #include <arpa/inet.h> /* Must be after netinet/in.h */
1105: #include <netdb.h>
1106: #define TCP_INCLUDES_DONE
1107: #endif
1108: </PRE>
1109:
1110: <H3>Definition of errno and Return Code</H3>
1111:
2.41 frystyk 1112: This is the definition of error codes and the corresponding string
1113: constants. If we do not have the <CODE>strerror</CODE> function then
1114: try the error list table.
1115:
2.37 frystyk 1116: <PRE>
1117: #ifndef ERRNO_DONE
1118: extern int errno;
1119: #define socerrno errno
1120: #endif
2.41 frystyk 1121:
1122: #ifndef HAVE_STRERROR /* Otherwise use the table */
1123: extern char *sys_errlist[];
1124: extern int sys_nerr;
1125: #endif
2.37 frystyk 1126: </PRE>
1127:
1128: <H3>Definition of Socket Desrciptores</H3>
2.19 luotonen 1129:
2.37 frystyk 1130: This is necessary in order to support Windows NT...
2.19 luotonen 1131:
2.37 frystyk 1132: <PRE>
1133: #ifndef SOCKFD
1134: #define SOCKFD int /* Unix like socket descriptor */
1135: #define INVSOC -1 /* Unix invalid socket */
1136: #endif
2.26 frystyk 1137: </PRE>
2.59 frystyk 1138:
1139: <H3>Additional Network variables for SOCKET, file access bits</h3>
1140:
1141: <PRE>
2.66 frystyk 1142: #ifndef _WINSOCKAPI_
2.59 frystyk 1143: #define FD_READ 0x01
1144: #define FD_WRITE 0x02
1145: #define FD_OOB 0x04
1146: #define FD_ACCEPT 0x08
1147: #define FD_CONNECT 0x10
1148: #define FD_CLOSE 0x20
1149:
1150: typedef unsigned int SOCKET ;
1151:
1152: #endif /* _WINSOCKAPI_ */
1153: </PRE>
1154:
2.1 timbl 1155:
2.26 frystyk 1156: <H3>Rough estimate of max path length</H3>
2.37 frystyk 1157:
2.26 frystyk 1158: <PRE>
1159: #ifndef HT_MAX_PATH
1160: #ifdef MAXPATHLEN
1161: #define HT_MAX_PATH MAXPATHLEN
1162: #else
1163: #ifdef PATH_MAX
1164: #define HT_MAX_PATH PATH_MAX
1165: #else
1166: #define HT_MAX_PATH 1024 /* Any better ideas? */
1167: #endif
1168: #endif
1169: #endif /* HT_MAX_PATH */
1170: </PRE>
2.1 timbl 1171:
2.37 frystyk 1172: <H3>Definition of NGROUPS</H3>
2.26 frystyk 1173:
1174: <PRE>
1175: #ifdef NO_UNIX_IO
1176: #define NO_GROUPS
1177: #endif
1178:
1179: #ifndef NO_GROUPS
1180: #ifndef NGROUPS
1181: #ifdef NGROUPS_MAX
1182: #define NGROUPS NGROUPS_MAX
1183: #else
1184: #define NGROUPS 20 /* Any better ideas? */
1185: #endif
2.37 frystyk 1186: #endif
2.34 frystyk 1187: #endif
1188: </PRE>
1189:
2.29 frystyk 1190: <H3>Definition of Max Domain Name Length</H3>
1191: <PRE>
1192: #ifndef MAXHOSTNAMELEN
1193: #define MAXHOSTNAMELEN 64 /* Any better ideas? */
1194: #endif
1195: </PRE>
1196:
2.41 frystyk 1197: <H3>File/Directory Management</H3>
1198: <PRE>
1199: #ifndef MKDIR
1200: #define MKDIR(a,b) mkdir((a), (b))
1201: #endif
1202:
2.56 frystyk 1203: #ifndef RMDIR
1204: #define RMDIR(a) rmdir((a))
1205: #endif
1206:
1207: #ifndef REMOVE
1208: #define REMOVE(a) unlink((a))
2.47 frystyk 1209: #endif
1210:
1211: #ifndef DEFAULT_SUFFIXES
1212: #define DEFAULT_SUFFIXES ".,_"
2.41 frystyk 1213: #endif
2.53 frystyk 1214:
1215: #ifndef FCNTL
1216: #define FCNTL(r,s,t) fcntl((r),(s),(t))
1217: #endif
2.41 frystyk 1218: </PRE>
1219:
2.26 frystyk 1220: <H3>Macros for manipulating masks for select()</H3>
1221: <PRE>
1222: #ifdef SELECT
2.1 timbl 1223: #ifndef FD_SET
1224: typedef unsigned int fd_set;
2.2 timbl 1225: #define FD_SET(fd,pmask) (*(pmask)) |= (1<<(fd))
1226: #define FD_CLR(fd,pmask) (*(pmask)) &= ~(1<<(fd))
2.1 timbl 1227: #define FD_ZERO(pmask) (*(pmask))=0
2.2 timbl 1228: #define FD_ISSET(fd,pmask) (*(pmask) & (1<<(fd)))
2.1 timbl 1229: #endif /* FD_SET */
1230: #endif /* SELECT */
2.26 frystyk 1231: </PRE>
1232:
1233: <H3>Macros for converting characters</H3>
2.1 timbl 1234:
2.26 frystyk 1235: <PRE>
1236: #ifndef TOASCII
2.1 timbl 1237: #define TOASCII(c) (c)
1238: #define FROMASCII(c) (c)
2.5 timbl 1239: #endif
2.26 frystyk 1240: </PRE>
1241:
1242: <H3>Cache file prefix</H3>
2.5 timbl 1243:
2.26 frystyk 1244: This is something onto which we tag something meaningful to make a cache
1245: file name. used in HTWSRC.c at least. If it is nor defined at all, caching
2.5 timbl 1246: is turned off.
2.26 frystyk 1247:
1248: <PRE>
1249: #ifndef CACHE_FILE_PREFIX
2.54 frystyk 1250: #if defined(unix) || defined(__unix__)
2.6 timbl 1251: #define CACHE_FILE_PREFIX "/usr/wsrc/"
2.5 timbl 1252: #endif
2.60 frystyk 1253: #endif
1254: </PRE>
1255:
1256: <H3>Thread Safe Setup</H3>
1257:
1258: These are some constants setting the size of buffers used by thread
1259: safe versions of some system calls.
1260:
1261: <PRE>
1262: #ifdef HT_REENTRANT
1263: #define HOSTENT_MAX 128
1264: #define CTIME_MAX 26
2.1 timbl 1265: #endif
2.17 luotonen 1266: </PRE>
1267:
1268: <PRE>
1269: #endif
1270: </PRE>
2.26 frystyk 1271: End of system-specific file
1272: </BODY>
2.7 timbl 1273: </HTML>
Webmaster