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