]> gitweb.factorcode.org Git - factor.git/blob - basis/unix/ffi/macosx/macosx.factor
use radix literals
[factor.git] / basis / unix / ffi / macosx / macosx.factor
1 USING: alien alien.c-types alien.libraries alien.syntax
2 classes.struct combinators kernel system unix unix.time
3 unix.types vocabs vocabs.loader ;
4 IN: unix.ffi
5
6 CONSTANT: MAXPATHLEN 1024
7
8 CONSTANT: O_RDONLY   0x0000
9 CONSTANT: O_WRONLY   0x0001
10 CONSTANT: O_RDWR     0x0002
11 CONSTANT: O_NONBLOCK 0x0004
12 CONSTANT: O_APPEND   0x0008
13 CONSTANT: O_CREAT    0x0200
14 CONSTANT: O_TRUNC    0x0400
15 CONSTANT: O_EXCL     0x0800
16 CONSTANT: O_NOCTTY   0x20000
17 ALIAS: O_NDELAY O_NONBLOCK
18
19 CONSTANT: SOL_SOCKET 0xffff
20 CONSTANT: SO_REUSEADDR 0x4
21 CONSTANT: SO_OOBINLINE 0x100
22 CONSTANT: SO_SNDTIMEO 0x1005
23 CONSTANT: SO_RCVTIMEO 0x1006
24
25 CONSTANT: F_SETFD 2
26 CONSTANT: F_SETFL 4
27 CONSTANT: FD_CLOEXEC 1
28
29 STRUCT: sockaddr-in
30     { len uchar }
31     { family uchar }
32     { port ushort }
33     { addr in_addr_t }
34     { unused longlong } ;
35
36 STRUCT: sockaddr-in6
37     { len uchar }
38     { family uchar }
39     { port ushort }
40     { flowinfo uint }
41     { addr uchar[16] }
42     { scopeid uint } ;
43
44 STRUCT: sockaddr-un
45     { len uchar }
46     { family uchar }
47     { path char[104] } ;
48
49 STRUCT: passwd
50     { pw_name c-string }
51     { pw_passwd c-string }
52     { pw_uid uid_t }
53     { pw_gid gid_t }
54     { pw_change time_t }
55     { pw_class c-string }
56     { pw_gecos c-string }
57     { pw_dir c-string }
58     { pw_shell c-string }
59     { pw_expire time_t }
60     { pw_fields int } ;
61
62 CONSTANT: max-un-path 104
63
64 CONSTANT: SOCK_STREAM 1
65 CONSTANT: SOCK_DGRAM 2
66 CONSTANT: SOCK_RAW 3
67
68 CONSTANT: AF_UNSPEC 0
69 CONSTANT: AF_UNIX 1
70 CONSTANT: AF_INET 2
71
72 ALIAS: PF_UNSPEC AF_UNSPEC
73 ALIAS: PF_UNIX AF_UNIX
74 ALIAS: PF_INET AF_INET
75
76 CONSTANT: IPPROTO_TCP 6
77 CONSTANT: IPPROTO_UDP 17
78
79 CONSTANT: AI_PASSIVE 1
80
81 CONSTANT: SEEK_SET 0
82 CONSTANT: SEEK_CUR 1
83 CONSTANT: SEEK_END 2
84
85 CONSTANT: FD_SETSIZE 1024
86
87 CONSTANT: AF_INET6 30
88 ALIAS: PF_INET6 AF_INET6
89
90 STRUCT: addrinfo
91     { flags int }
92     { family int } 
93     { socktype int }
94     { protocol int }
95     { addrlen socklen_t }
96     { canonname c-string }
97     { addr void* }
98     { next addrinfo* } ;
99
100 CONSTANT: _UTX_USERSIZE 256
101 CONSTANT: _UTX_LINESIZE 32
102 CONSTANT: _UTX_IDSIZE 4
103 CONSTANT: _UTX_HOSTSIZE 256
104
105 STRUCT: utmpx
106     { ut_user { char _UTX_USERSIZE } }
107     { ut_id   { char _UTX_IDSIZE   } }
108     { ut_line { char _UTX_LINESIZE } }
109     { ut_pid  pid_t }
110     { ut_type short }
111     { ut_tv   timeval }
112     { ut_host { char _UTX_HOSTSIZE } }
113     { ut_pad  { uint 16 } } ;
114
115 CONSTANT: __DARWIN_MAXPATHLEN 1024
116 CONSTANT: __DARWIN_MAXNAMELEN 255
117 CONSTANT: __DARWIN_MAXNAMELEN+1 256
118
119 STRUCT: dirent
120     { d_ino ino_t }
121     { d_reclen __uint16_t }
122     { d_type __uint8_t }
123     { d_namlen __uint8_t }
124     { d_name { char __DARWIN_MAXNAMELEN+1 } } ;
125
126 CONSTANT: EPERM 1
127 CONSTANT: ENOENT 2
128 CONSTANT: ESRCH 3
129 CONSTANT: EINTR 4
130 CONSTANT: EIO 5
131 CONSTANT: ENXIO 6
132 CONSTANT: E2BIG 7
133 CONSTANT: ENOEXEC 8
134 CONSTANT: EBADF 9
135 CONSTANT: ECHILD 10
136 CONSTANT: EDEADLK 11
137 CONSTANT: ENOMEM 12
138 CONSTANT: EACCES 13
139 CONSTANT: EFAULT 14
140 CONSTANT: ENOTBLK 15
141 CONSTANT: EBUSY 16
142 CONSTANT: EEXIST 17
143 CONSTANT: EXDEV 18
144 CONSTANT: ENODEV 19
145 CONSTANT: ENOTDIR 20
146 CONSTANT: EISDIR 21
147 CONSTANT: EINVAL 22
148 CONSTANT: ENFILE 23
149 CONSTANT: EMFILE 24
150 CONSTANT: ENOTTY 25
151 CONSTANT: ETXTBSY 26
152 CONSTANT: EFBIG 27
153 CONSTANT: ENOSPC 28
154 CONSTANT: ESPIPE 29
155 CONSTANT: EROFS 30
156 CONSTANT: EMLINK 31
157 CONSTANT: EPIPE 32
158 CONSTANT: EDOM 33
159 CONSTANT: ERANGE 34
160 CONSTANT: EAGAIN 35
161 ALIAS: EWOULDBLOCK EAGAIN
162 CONSTANT: EINPROGRESS 36
163 CONSTANT: EALREADY 37
164 CONSTANT: ENOTSOCK 38
165 CONSTANT: EDESTADDRREQ 39
166 CONSTANT: EMSGSIZE 40
167 CONSTANT: EPROTOTYPE 41
168 CONSTANT: ENOPROTOOPT 42
169 CONSTANT: EPROTONOSUPPORT 43
170 CONSTANT: ESOCKTNOSUPPORT 44
171 CONSTANT: ENOTSUP 45
172 CONSTANT: EPFNOSUPPORT 46
173 CONSTANT: EAFNOSUPPORT 47
174 CONSTANT: EADDRINUSE 48
175 CONSTANT: EADDRNOTAVAIL 49
176 CONSTANT: ENETDOWN 50
177 CONSTANT: ENETUNREACH 51
178 CONSTANT: ENETRESET 52
179 CONSTANT: ECONNABORTED 53
180 CONSTANT: ECONNRESET 54
181 CONSTANT: ENOBUFS 55
182 CONSTANT: EISCONN 56
183 CONSTANT: ENOTCONN 57
184 CONSTANT: ESHUTDOWN 58
185 CONSTANT: ETOOMANYREFS 59
186 CONSTANT: ETIMEDOUT 60
187 CONSTANT: ECONNREFUSED 61
188 CONSTANT: ELOOP 62
189 CONSTANT: ENAMETOOLONG 63
190 CONSTANT: EHOSTDOWN 64
191 CONSTANT: EHOSTUNREACH 65
192 CONSTANT: ENOTEMPTY 66
193 CONSTANT: EPROCLIM 67
194 CONSTANT: EUSERS 68
195 CONSTANT: EDQUOT 69
196 CONSTANT: ESTALE 70
197 CONSTANT: EREMOTE 71
198 CONSTANT: EBADRPC 72
199 CONSTANT: ERPCMISMATCH 73
200 CONSTANT: EPROGUNAVAIL 74
201 CONSTANT: EPROGMISMATCH 75
202 CONSTANT: EPROCUNAVAIL 76
203 CONSTANT: ENOLCK 77
204 CONSTANT: ENOSYS 78
205 CONSTANT: EFTYPE 79
206 CONSTANT: EAUTH 80
207 CONSTANT: ENEEDAUTH 81
208 CONSTANT: EPWROFF 82
209 CONSTANT: EDEVERR 83
210 CONSTANT: EOVERFLOW 84
211 CONSTANT: EBADEXEC 85
212 CONSTANT: EBADARCH 86
213 CONSTANT: ESHLIBVERS 87
214 CONSTANT: EBADMACHO 88
215 CONSTANT: ECANCELED 89
216 CONSTANT: EIDRM 90
217 CONSTANT: ENOMSG 91
218 CONSTANT: EILSEQ 92
219 CONSTANT: ENOATTR 93
220 CONSTANT: EBADMSG 94
221 CONSTANT: EMULTIHOP 95
222 CONSTANT: ENODATA 96
223 CONSTANT: ENOLINK 97
224 CONSTANT: ENOSR 98
225 CONSTANT: ENOSTR 99
226 CONSTANT: EPROTO 100
227 CONSTANT: ETIME 101
228 CONSTANT: EOPNOTSUPP 102
229 CONSTANT: ENOPOLICY 103
230
231 CONSTANT: SIGHUP     1
232 CONSTANT: SIGINT     2
233 CONSTANT: SIGQUIT    3
234 CONSTANT: SIGILL     4
235 CONSTANT: SIGTRAP    5
236 CONSTANT: SIGABRT    6
237 CONSTANT: SIGEMT     7
238 CONSTANT: SIGFPE     8
239 CONSTANT: SIGKILL    9
240 CONSTANT: SIGBUS    10
241 CONSTANT: SIGSEGV   11
242 CONSTANT: SIGSYS    12
243 CONSTANT: SIGPIPE   13
244 CONSTANT: SIGALRM   14
245 CONSTANT: SIGTERM   15
246 CONSTANT: SIGURG    16
247 CONSTANT: SIGSTOP   17
248 CONSTANT: SIGTSTP   18
249 CONSTANT: SIGCONT   19
250 CONSTANT: SIGCHLD   20
251 CONSTANT: SIGTTIN   21
252 CONSTANT: SIGTTOU   22
253 CONSTANT: SIGIO     23
254 CONSTANT: SIGXCPU   24
255 CONSTANT: SIGXFSZ   25
256 CONSTANT: SIGVTALRM 26
257 CONSTANT: SIGPROF   27
258 CONSTANT: SIGWINCH  28
259 CONSTANT: SIGINFO   29
260 CONSTANT: SIGUSR1   30
261 CONSTANT: SIGUSR2   31