| 1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
< |
/* SCCSid "$SunId$ LBL" */ |
| 3 |
> |
/* SCCSid "$SunId$ SGI" */ |
| 4 |
|
|
| 5 |
|
/* |
| 6 |
|
* Miscellaneous definitions required by many routines. |
| 26 |
|
XF b; /* backward */ |
| 27 |
|
} FULLXF; |
| 28 |
|
|
| 29 |
+ |
#ifndef PI |
| 30 |
|
#ifdef M_PI |
| 31 |
|
#define PI M_PI |
| 32 |
|
#else |
| 33 |
|
#define PI 3.14159265358979323846 |
| 34 |
|
#endif |
| 35 |
+ |
#endif |
| 36 |
|
|
| 37 |
|
#ifndef F_OK /* mode bits for access(2) call */ |
| 38 |
|
#define R_OK 4 /* readable */ |
| 40 |
|
#define X_OK 1 /* executable */ |
| 41 |
|
#define F_OK 0 /* exists */ |
| 42 |
|
#endif |
| 43 |
+ |
|
| 44 |
+ |
extern int eputs(), wputs(); /* standard error output functions */ |
| 45 |
+ |
|
| 46 |
|
/* error codes */ |
| 47 |
< |
#define WARNING 1 /* non-fatal error */ |
| 48 |
< |
#define USER 2 /* fatal user-caused error */ |
| 49 |
< |
#define SYSTEM 3 /* fatal system-related error */ |
| 50 |
< |
#define INTERNAL 4 /* fatal program-related error */ |
| 51 |
< |
#define CONSISTENCY 5 /* bad consistency check, abort */ |
| 52 |
< |
#define COMMAND 6 /* interactive error */ |
| 47 |
> |
#define WARNING 0 /* non-fatal error */ |
| 48 |
> |
#define USER 1 /* fatal user-caused error */ |
| 49 |
> |
#define SYSTEM 2 /* fatal system-related error */ |
| 50 |
> |
#define INTERNAL 3 /* fatal program-related error */ |
| 51 |
> |
#define CONSISTENCY 4 /* bad consistency check, abort */ |
| 52 |
> |
#define COMMAND 5 /* interactive error */ |
| 53 |
> |
#define NERRS 6 |
| 54 |
> |
/* error struct */ |
| 55 |
> |
extern struct erract { |
| 56 |
> |
char pre[16]; /* prefix message */ |
| 57 |
> |
int (*pf)(); /* put function (resettable) */ |
| 58 |
> |
int ec; /* exit code (0 means non-fatal) */ |
| 59 |
> |
} erract[NERRS]; /* list of error actions */ |
| 60 |
|
|
| 61 |
+ |
#define ERRACT_INIT { {"warning - ", wputs, 0}, \ |
| 62 |
+ |
{"fatal - ", eputs, 1}, \ |
| 63 |
+ |
{"system - ", eputs, 2}, \ |
| 64 |
+ |
{"internal - ", eputs, 1}, \ |
| 65 |
+ |
{"consistency - ", eputs, -1}, \ |
| 66 |
+ |
{"", NULL, 0} } |
| 67 |
+ |
|
| 68 |
|
extern char errmsg[]; /* global buffer for error messages */ |
| 69 |
|
|
| 70 |
|
/* memory operations */ |
| 78 |
|
#define bcopy(s,d,n) (void)memcpy(d,s,n) |
| 79 |
|
#define bzero(d,n) (void)memset(d,0,n) |
| 80 |
|
#define bcmp(b1,b2,n) memcmp(b1,b2,n) |
| 62 |
– |
extern char *memcpy(), *memset(); |
| 81 |
|
#define index strchr |
| 82 |
|
#define rindex strrchr |
| 83 |
|
#endif |
| 84 |
|
|
| 85 |
< |
extern char *sskip(); |
| 85 |
> |
extern char *sskip(), *sskip2(); |
| 86 |
|
extern char *getpath(), *getenv(); |
| 87 |
|
#ifndef malloc |
| 88 |
|
extern char *malloc(), *calloc(), *realloc(); |