1 /* $Source: /u/mark/src/pax/RCS/port.h,v $
5 * port.h - defnitions for portability library
9 * Header for maintaing portablilty across operating system and
10 * version boundries. For the most part, this file contains
11 * definitions which map functions which have the same functionality
12 * but different names on different systems, to have the same name.
16 * Mark H. Colburn, NAPS International (mark@jhereg.mn.org)
17 * John Gilmore (gnu@hoptoad)
19 * Sponsored by The USENIX Association for public distribution.
21 * Copyright (c) 1989 Mark H. Colburn.
22 * All rights reserved.
24 * Redistribution and use in source and binary forms are permitted
25 * provided that the above copyright notice and this paragraph are
26 * duplicated in all such forms and that any documentation,
27 * advertising materials, and other materials related to such
28 * distribution and use acknowledge that the software was developed
29 * by Mark H. Colburn and sponsored by The USENIX Association.
31 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
32 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
33 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
40 * Everybody does wait() differently. There seem to be no definitions for
41 * this in V7 (e.g. you are supposed to shift and mask things out using
42 * constant shifts and masks.) In order to provide the functionality, here
43 * are some non standard but portable macros. Don't change to a "union wait"
44 * based approach -- the ordering of the elements of the struct depends on the
45 * byte-sex of the machine.
48 #define TERM_SIGNAL(status) ((status) & 0x7F)
49 #define TERM_COREDUMP(status) (((status) & 0x80) != 0)
50 #define TERM_VALUE(status) ((status) >> 8)
53 * String library emulation definitions for the different variants of UNIX
66 * The following functions are defined here since func.h has no idea which
67 * of the functions will actually be used.
70 extern char *rindex(char *, char);
71 extern char *index(char *, char);
72 extern char *bcopy(char *, char *, unsigned int);
73 extern char *bzero(char *, unsigned int);
74 extern char *strcat(char *, char *);
75 extern char *strcpy(char *, char *);
76 # else /* !__STDC__ */
77 extern char *rindex();
81 extern char *strcat();
82 extern char *strcpy();
83 # endif /* __STDC__ */
86 * Map ANSI C compatible functions to V7 functions
89 # define memcpy(a,b,n) bcopy((b),(a),(n))
90 # define memset(a,b,n) bzero((a),(n))
91 # define strrchr(s,c) rindex(s,c)
92 # define strchr(s,c) index(s,c)
95 #endif /* _PAX_PORT_H */