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

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

Compilation Mac pour CodeWarrior PRO 5

File size: 4.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_PI 3.14159265358979
114#endif
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif
Note: See TracBrowser for help on using the repository browser.