8 |
|
|
9 |
|
#include <stdio.h> |
10 |
|
|
11 |
+ |
#include <sys/types.h> |
12 |
+ |
|
13 |
|
#include <fcntl.h> |
14 |
|
|
15 |
|
#include <math.h> |
30 |
|
|
31 |
|
#ifndef PI |
32 |
|
#ifdef M_PI |
33 |
< |
#define PI M_PI |
33 |
> |
#define PI ((double)M_PI) |
34 |
|
#else |
35 |
|
#define PI 3.14159265358979323846 |
36 |
|
#endif |
46 |
|
extern int eputs(), wputs(); /* standard error output functions */ |
47 |
|
|
48 |
|
/* error codes */ |
49 |
< |
#define WARNING 1 /* non-fatal error */ |
50 |
< |
#define USER 2 /* fatal user-caused error */ |
51 |
< |
#define SYSTEM 3 /* fatal system-related error */ |
52 |
< |
#define INTERNAL 4 /* fatal program-related error */ |
53 |
< |
#define CONSISTENCY 5 /* bad consistency check, abort */ |
54 |
< |
#define COMMAND 6 /* interactive error */ |
55 |
< |
#define NERRS 7 |
49 |
> |
#define WARNING 0 /* non-fatal error */ |
50 |
> |
#define USER 1 /* fatal user-caused error */ |
51 |
> |
#define SYSTEM 2 /* fatal system-related error */ |
52 |
> |
#define INTERNAL 3 /* fatal program-related error */ |
53 |
> |
#define CONSISTENCY 4 /* bad consistency check, abort */ |
54 |
> |
#define COMMAND 5 /* interactive error */ |
55 |
> |
#define NERRS 6 |
56 |
|
/* error struct */ |
57 |
|
extern struct erract { |
58 |
|
char pre[16]; /* prefix message */ |
76 |
|
#define copystruct(d,s) (*(d) = *(s)) |
77 |
|
#endif |
78 |
|
|
79 |
< |
#ifndef BSD |
79 |
> |
#ifdef BSD |
80 |
> |
extern long lseek(); |
81 |
> |
#else |
82 |
|
#define bcopy(s,d,n) (void)memcpy(d,s,n) |
83 |
|
#define bzero(d,n) (void)memset(d,0,n) |
84 |
|
#define bcmp(b1,b2,n) memcmp(b1,b2,n) |
85 |
|
#define index strchr |
86 |
|
#define rindex strrchr |
87 |
+ |
extern off_t lseek(); |
88 |
|
#endif |
89 |
+ |
extern long ftell(); |
90 |
|
|
91 |
|
extern char *sskip(), *sskip2(); |
92 |
|
extern char *getpath(), *getenv(); |