t_openbsd.h2paschk 3.9 KB

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