source: Sophya/trunk/SophyaLib/UnixMac/include/unixmac.h@ 3475

Last change on this file since 3475 was 781, checked in by ansari, 26 years ago

* empty log message *

File size: 5.3 KB
Line 
1#ifndef UNIXMAC_SEEN
2#define UNIXMAC_SEEN
3
4#include <unix.h>
5#include "macshm.h"
6#include "sys/types.h"
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12//#define sleep sleep_mac
13
14void InitToolBox();
15void yield();
16extern int _wakeup;
17extern int macSleepTicks;
18extern int macRunTicks;
19
20/*typedef long pid_t;*/
21#define SIGKILL 9
22
23
24//int utimes(char* fn, void* tvp);
25//unsigned int sleep(unsigned int secs);
26char * basename(char * path);
27
28int kill(int , int );
29int link(char* src, char* dst);
30int fork(void);
31
32#define ESUCCESS 0 /* Successful */
33#define EPERM 1 /* Not owner */
34#define ENOENT 2 /* No such file or directory */
35#define ESRCH 3 /* No such process */
36#define EINTR 4 /* Interrupted system call */
37#define EIO 5 /* I/O error */
38#define ENXIO 6 /* No such device or address */
39#define E2BIG 7 /* Arg list too long */
40#define ENOEXEC 8 /* Exec format error */
41#define EBADF 9 /* Bad file number */
42#define ECHILD 10 /* No children */
43#define EDEADLK 11 /* Operation would cause deadlock */
44#define ENOMEM 12 /* Not enough core */
45#define EACCES 13 /* Permission denied */
46#define EFAULT 14 /* Bad address */
47#define ENOTBLK 15 /* Block device required */
48#define EBUSY 16 /* Mount device busy */
49#define EEXIST 17 /* File exists */
50#define EXDEV 18 /* Cross-device link */
51#define ENODEV 19 /* No such device */
52#define ENOTDIR 20 /* Not a directory*/
53#define EISDIR 21 /* Is a directory */
54#define EINVAL 22 /* Invalid argument */
55#define ENFILE 23 /* File table overflow */
56#define EMFILE 24 /* Too many open files */
57#define ENOTTY 25 /* Not a typewriter */
58#define ETXTBSY 26 /* Text file busy */
59#define EFBIG 27 /* File too large */
60#define ENOSPC 28 /* No space left on device */
61#define ESPIPE 29 /* Illegal seek */
62#define EROFS 30 /* Read-only file system */
63#define EMLINK 31 /* Too many links */
64#define EPIPE 32 /* Broken pipe */
65
66extern char* sys_errlist[];
67
68#define F_ULOCK 0 /* Unlock a previously locked region */
69#define F_LOCK 1 /* Lock a region for exclusive use */
70#define F_TLOCK 2 /* Test and lock a region for exclusive use */
71#define F_TEST 3 /* Test a region for other processes locks */
72
73#ifndef _MAXFLOAT
74#define _MAXFLOAT
75#define MAXFLOAT ((float)3.40282346638528860e+38)
76#endif
77
78struct drand48_data {
79 unsigned short X[3]; /* 48 bit integer value */
80 unsigned short a[3]; /* mutiplier value */
81 unsigned short c; /* addend value */
82 unsigned short old_X[3]; /* previous value of Xi */
83 int init; /* initialize ? */
84};
85
86extern double drand48 (void);
87extern double erand48 (unsigned short []);
88extern long jrand48 (unsigned short []);
89extern void lcong48 (unsigned short []);
90extern long lrand48 (void);
91extern long mrand48 (void);
92extern long nrand48 (unsigned short []);
93extern unsigned short *seed48 (unsigned short []);
94extern void srand48 (long);
95
96int __drand48_iterate (unsigned short int xsubi[3],struct drand48_data *buffer);
97
98extern int drand48_r (struct drand48_data *, double *);
99extern int erand48_r (unsigned short [],struct drand48_data *,double*);
100extern int lrand48_r (struct drand48_data *, long *);
101extern int mrand48_r (struct drand48_data *, long *);
102extern int srand48_r (long, struct drand48_data *);
103extern int seed48_r (unsigned short [], struct drand48_data *);
104extern int lcong48_r (unsigned short [], struct drand48_data *);
105extern int nrand48_r (unsigned short [], struct drand48_data *, long*);
106extern int jrand48_r (unsigned short [], struct drand48_data *, long*);
107
108typedef unsigned long long u_int64_t;
109
110int xccommand(char*** arg);
111
112#ifndef M_PI
113#define M_E 2.7182818284590452354E0 /*Hex 2^ 0 * 1.5bf0a8b145769 */
114#define M_LOG2E 1.4426950408889634074E0 /*Hex 2^ 0 * 1.71547652B82FE */
115#define M_LOG10E 4.3429448190325182765E-1 /*Hex 2^-2 * 1.BCB7B1526E50E */
116#define M_LN2 6.9314718055994530942E-1 /*Hex 2^-1 * 1.62E42FEFA39EF */
117#define M_LN10 2.3025850929940456840E0 /*Hex 2^ 1 * 1.26bb1bbb55516 */
118#define M_PI 3.1415926535897932385E0 /*Hex 2^ 1 * 1.921FB54442D18 */
119#define M_PI_2 1.5707963267948966192E0 /*Hex 2^ 0 * 1.921FB54442D18 */
120#define M_PI_4 7.8539816339744830962E-1 /*Hex 2^-1 * 1.921FB54442D18 */
121#define M_1_PI 3.1830988618379067154E-1 /*Hex 2^-2 * 1.45f306dc9c883 */
122#define M_2_PI 6.3661977236758134308E-1 /*Hex 2^-1 * 1.45f306dc9c883 */
123#define M_2_SQRTPI 1.1283791670955125739E0 /*Hex 2^ 0 * 1.20dd750429b6d */
124#define M_SQRT2 1.4142135623730950488E0 /*Hex 2^ 0 * 1.6A09E667F3BCD */
125#define M_SQRT1_2 7.0710678118654752440E-1 /*Hex 2^-1 * 1.6a09e667f3bcd */
126#endif
127
128#ifndef _MAXFLOAT
129#define _MAXFLOAT
130#define MAXFLOAT ((float)3.40282346638528860e+38)
131
132#endif
133
134#ifdef __cplusplus
135}
136#endif
137
138#endif
Note: See TracBrowser for help on using the repository browser.