t_openbsd.h2paschk 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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/types.h>
  15. @C #include <sys/stat.h>
  16. @C #include <sys/time.h>
  17. @C #include <sys/times.h>
  18. @C #include <sys/resource.h>
  19. @C #include <sys/uio.h>
  20. @C #include <dirent.h>
  21. @C #include <poll.h>
  22. @C #include <utime.h>
  23. @C #include <fcntl.h>
  24. @C #include <unistd.h>
  25. @C #include <stdio.h>
  26. @C #include <stddef.h>
  27. @C #include <fcntl.h>
  28. @C #include <pthread.h>
  29. @C #include <netdb.h>
  30. @C #include <semaphore.h>
  31. @C #include <wchar.h>
  32. @C #include <math.h>
  33. @C int main()
  34. @C {
  35. @type dev_t
  36. @type gid_t
  37. @type ino_t
  38. @type mode_t
  39. @type nlink_t
  40. @type off_t
  41. @type pid_t
  42. @type size_t
  43. @type ssize_t
  44. @type uid_t
  45. @type wint_t
  46. @type clock_t
  47. @type time_t
  48. @type socklen_t
  49. @record timeval,struct timeval
  50. .tv_sec
  51. .tv_usec
  52. @record timespec,struct timespec
  53. .tv_sec
  54. .tv_nsec
  55. @type pthread_t
  56. @type pthread_attr_t
  57. @type pthread_mutex_t
  58. @type pthread_mutexattr_t
  59. @type pthread_cond_t
  60. @type pthread_condattr_t
  61. @type pthread_key_t
  62. @type pthread_rwlock_t
  63. @type pthread_rwlockattr_t
  64. @type sem_t
  65. @type rlim_t
  66. @record pthread_once_t,struct pthread_once
  67. .state
  68. .mutex
  69. @constant O_RDONLY
  70. @constant O_WRONLY
  71. @constant O_RDWR
  72. @constant O_CREAT
  73. @constant O_EXCL
  74. @constant O_TRUNC
  75. @constant O_NOCTTY
  76. @constant O_APPEND
  77. @constant O_NONBLOCK
  78. @floatconstant PI,M_PI
  79. @record stat,struct stat
  80. .st_mode
  81. .st_dev
  82. .st_ino
  83. .st_nlink
  84. .st_uid
  85. .st_gid
  86. .st_rdev
  87. .st_atime
  88. .st_atimensec
  89. .st_mtime
  90. .st_mtimensec
  91. .st_ctime
  92. .st_ctimensec
  93. .st_size
  94. .st_blocks
  95. .st_blksize
  96. .st_flags
  97. .st_gen
  98. .st_birthtime,__st_birthtime
  99. .st_birthtimensec,__st_birthtimensec
  100. @record dirent,struct dirent
  101. .d_fileno
  102. .d_off
  103. .d_reclen
  104. .d_type
  105. .d_namlen
  106. .d_padding,__d_padding
  107. .d_name
  108. @record pollfd,struct pollfd
  109. .fd
  110. .events
  111. .revents
  112. @record utimbuf,struct utimbuf
  113. .actime
  114. .modtime
  115. @record flock,struct flock
  116. .l_start
  117. .l_len
  118. .l_pid
  119. .l_type
  120. .l_whence
  121. @record tms,struct tms
  122. .tms_utime
  123. .tms_stime
  124. .tms_cutime
  125. .tms_cstime
  126. @record timezone,struct timezone
  127. .tz_minuteswest
  128. .tz_dsttime
  129. @record rusage,struct rusage
  130. .ru_utime
  131. .ru_stime
  132. .ru_maxrss
  133. .ru_ixrss
  134. .ru_idrss
  135. .ru_isrss
  136. .ru_minflt
  137. .ru_majflt
  138. .ru_nswap
  139. .ru_inblock
  140. .ru_oublock
  141. .ru_msgsnd
  142. .ru_msgrcv
  143. .ru_nsignals
  144. .ru_nvcsw
  145. .ru_nivcsw
  146. @record TRLimit,struct rlimit
  147. .rlim_cur
  148. .rlim_max
  149. @record iovec,struct iovec
  150. .iov_base
  151. .iov_len
  152. @C return 0;
  153. @C }
  154. @Pascal end.