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
|
# 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
@C #define _LARGEFILE_SOURCE 1
@C #define _FILE_OFFSET_BITS 64
## @C #define _USE_FILE_OFFSET64
## @C #ifdef __i386__
## @C #define _LARGEFILE64_SOURCE
## @C #endif
@C #include <sys/types.h>
@C #include <sys/stat.h>
@C #include <sys/statfs.h>
@C #include <sys/mount.h>
@C #include <sys/time.h>
@C #include <sys/times.h>
@C #include <sys/resource.h>
@C #include <sys/uio.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 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 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 rlim_t
@record stat,struct stat
.st_dev
.st_ino
.st_mode
#.st_padding0
.st_nlink
.st_uid
.st_gid
#.st_padding1
.st_rdev
.st_size
.st_blocks
.st_blksize
.st_atime,st_atim.tv_sec
.st_atime_nsec,st_atim.tv_nsec
.st_mtime,st_mtim.tv_sec
.st_mtime_nsec,st_mtim.tv_nsec
.st_ctime,st_ctim.tv_sec
.st_ctime_nsec,st_ctim.tv_nsec
@Pascal {$if defined (CPUPOWERPC) or defined(CPUPOWERPC64)}
@C #ifdef __powerpc__
.__unused4
.__unused5
@Pascal {$ifdef CPU64}
@C #ifdef __LP64__
.__unused6
@C #endif
@Pascal {$endif CPU64}
@C #endif
@Pascal {$endif powerpc}
#.st_flags
#.st_gen
@record dirent,struct dirent
.d_fileno
.d_off
.d_reclen
.d_type
#.d_pad0
#.d_namlen
#.d_pad1
.d_name
@record TStatFs,struct statfs
.fstype,f_type
.bsize,f_bsize
.blocks,f_blocks
.bfree,f_bfree
.bavail,f_bavail
.files,f_files
.ffree,f_ffree
.fsid,f_fsid
.namelen,f_namelen
.frsize,f_frsize
.flags,f_flags
.spare,f_spare
@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.
|