1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
# OpenBSD RTL-to-C structure compatibility checker description file
#
# Use
# h2paschk t_openbsd.h2paschk
#
# ...to generate Pascal and C code, then make sure they both compile and that
# the Pascal program produces the same output as the C program for each
# supported architecture.
@Pascal uses baseunix;
@Pascal {$i ptypes.inc}
@Pascal {$i ostypes.inc}
@Pascal begin
# Adds support for M_PIl constant inside math.h header
@C #include <sys/mman.h>
@C #include <sys/types.h>
@C #include <sys/stat.h>
@C #include <sys/time.h>
@C #include <sys/times.h>
@C #include <sys/resource.h>
@C #include <sys/uio.h>
@C #include <sys/wait.h>
@C #include <dirent.h>
@C #include <poll.h>
@C #include <utime.h>
@C #include <fcntl.h>
@C #include <unistd.h>
@C #include <stdio.h>
@C #include <stddef.h>
@C #include <fcntl.h>
@C #include <pthread.h>
@C #include <netdb.h>
@C #include <semaphore.h>
@C #include <wchar.h>
@C #include <math.h>
@C int main()
@C {
@type dev_t
@type gid_t
@type ino_t
@type mode_t
@type nlink_t
@type off_t
@type pid_t
@type size_t
@type ssize_t
@type uid_t
@type wint_t
@type clock_t
@type time_t
@type socklen_t
@record timeval,struct timeval
.tv_sec
.tv_usec
@record timespec,struct timespec
.tv_sec
.tv_nsec
@type pthread_t
@type pthread_attr_t
@type pthread_mutex_t
@type pthread_mutexattr_t
@type pthread_cond_t
@type pthread_condattr_t
@type pthread_key_t
@type pthread_rwlock_t
@type pthread_rwlockattr_t
@type sem_t
@type rlim_t
@record pthread_once_t,struct pthread_once
.state
.mutex
@constant F_OK
@constant R_OK
@constant W_OK
@constant X_OK
@constant SEEK_SET
@constant SEEK_CUR
@constant SEEK_END
@constant O_RDONLY
@constant O_WRONLY
@constant O_RDWR
@constant O_CREAT
@constant O_EXCL
@constant O_TRUNC
@constant O_NOCTTY
@constant O_APPEND
@constant O_NONBLOCK
@constant S_IRUSR
@constant S_IWUSR
@constant S_IXUSR
@constant S_IRGRP
@constant S_IWGRP
@constant S_IXGRP
@constant S_IROTH
@constant S_IWOTH
@constant S_IXOTH
@constant S_IRWXU
@constant S_IRWXG
@constant S_IRWXO
@constant WNOHANG
@constant WUNTRACED
@constant F_DUPFD
@constant F_GETFD
@constant F_SETFD
@constant F_GETFL
@constant F_SETFL
@constant F_GETOWN
@constant F_SETOWN
@constant F_GETLK
@constant F_SETLK
@constant F_SETLKW
@constant F_DUPFD_CLOEXEC
@constant FD_CLOEXEC
@constant F_RDLCK
@constant F_UNLCK
@constant F_WRLCK
@constant RLIMIT_CPU
@constant RLIMIT_FSIZE
@constant RLIMIT_DATA
@constant RLIMIT_STACK
@constant RLIMIT_CORE
@constant RLIMIT_RSS
@constant RLIMIT_MEMLOCK
@constant RLIMIT_NPROC
@constant RLIMIT_NOFILE
# @constant RLIMIT_AS alias of RLIMIT_RSS, but not in C headers
@constant MAP_PRIVATE
@constant MAP_ANONYMOUS
@constant POLLIN
@constant POLLPRI
@constant POLLOUT
@constant POLLERR
@constant POLLHUP
@constant POLLNVAL
@constant POLLRDNORM
@constant POLLRDBAND
@constant POLLWRNORM
@constant POLLWRBAND
@floatconstant PI,M_PI
@record stat,struct stat
.st_mode
.st_dev
.st_ino
.st_nlink
.st_uid
.st_gid
.st_rdev
.st_atime
.st_atimensec
.st_mtime
.st_mtimensec
.st_ctime
.st_ctimensec
.st_size
.st_blocks
.st_blksize
.st_flags
.st_gen
.st_birthtime,__st_birthtime
.st_birthtimensec,__st_birthtimensec
@record dirent,struct dirent
.d_fileno
.d_off
.d_reclen
.d_type
.d_namlen
.d_padding,__d_padding
.d_name
@record pollfd,struct pollfd
.fd
.events
.revents
@record utimbuf,struct utimbuf
.actime
.modtime
@record flock,struct flock
.l_start
.l_len
.l_pid
.l_type
.l_whence
@record tms,struct tms
.tms_utime
.tms_stime
.tms_cutime
.tms_cstime
@record timezone,struct timezone
.tz_minuteswest
.tz_dsttime
@record rusage,struct rusage
.ru_utime
.ru_stime
.ru_maxrss
.ru_ixrss
.ru_idrss
.ru_isrss
.ru_minflt
.ru_majflt
.ru_nswap
.ru_inblock
.ru_oublock
.ru_msgsnd
.ru_msgrcv
.ru_nsignals
.ru_nvcsw
.ru_nivcsw
@record TRLimit,struct rlimit
.rlim_cur
.rlim_max
@record iovec,struct iovec
.iov_base
.iov_len
@C return 0;
@C }
@Pascal end.
|