stdio_netbsd_amd64.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. // Code generated by 'ccgo stdio/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -ignore-unsupported-alignment -o stdio/stdio_netbsd_amd64.go -pkgname stdio', DO NOT EDIT.
  2. package stdio
  3. import (
  4. "math"
  5. "reflect"
  6. "sync/atomic"
  7. "unsafe"
  8. )
  9. var _ = math.Pi
  10. var _ reflect.Kind
  11. var _ atomic.Value
  12. var _ unsafe.Pointer
  13. const (
  14. BUFSIZ = 1024 // stdio.h:182:1:
  15. EOF = -1 // stdio.h:183:1:
  16. FILENAME_MAX = 1024 // stdio.h:192:1:
  17. FOPEN_MAX = 20 // stdio.h:191:1:
  18. FPARSELN_UNESCALL = 0x0f // stdio.h:411:1:
  19. FPARSELN_UNESCCOMM = 0x04 // stdio.h:409:1:
  20. FPARSELN_UNESCCONT = 0x02 // stdio.h:408:1:
  21. FPARSELN_UNESCESC = 0x01 // stdio.h:407:1:
  22. FPARSELN_UNESCREST = 0x08 // stdio.h:410:1:
  23. L_ctermid = 1024 // stdio.h:292:1:
  24. L_cuserid = 9 // stdio.h:293:1:
  25. L_tmpnam = 1024 // stdio.h:198:1:
  26. P_tmpdir = "/tmp/" // stdio.h:196:1:
  27. SEEK_CUR = 1 // stdio.h:209:1:
  28. SEEK_END = 2 // stdio.h:212:1:
  29. SEEK_SET = 0 // stdio.h:206:1:
  30. TMP_MAX = 308915776 // stdio.h:201:1:
  31. X_AMD64_INT_TYPES_H_ = 0 // int_types.h:35:1:
  32. X_FILE_OFFSET_BITS = 64 // <builtin>:25:1:
  33. X_FSTDIO = 0 // stdio.h:72:1:
  34. X_IOFBF = 0 // stdio.h:178:1:
  35. X_IOLBF = 1 // stdio.h:179:1:
  36. X_IONBF = 2 // stdio.h:180:1:
  37. X_LP64 = 1 // <predefined>:268:1:
  38. X_NETBSD_SOURCE = 1 // featuretest.h:70:1:
  39. X_STDIO_H_ = 0 // stdio.h:38:1:
  40. X_SYS_ANSI_H_ = 0 // ansi.h:33:1:
  41. X_SYS_CDEFS_ELF_H_ = 0 // cdefs_elf.h:31:1:
  42. X_SYS_CDEFS_H_ = 0 // cdefs.h:37:1:
  43. X_SYS_COMMON_ANSI_H_ = 0 // common_ansi.h:33:1:
  44. X_SYS_COMMON_INT_TYPES_H_ = 0 // common_int_types.h:33:1:
  45. X_SYS_NULL_H_ = 0 // null.h:9:1:
  46. X_X86_64_CDEFS_H_ = 0 // cdefs.h:4:1:
  47. )
  48. type Ptrdiff_t = int64 /* <builtin>:3:26 */
  49. type Size_t = uint64 /* <builtin>:9:23 */
  50. type Wchar_t = int32 /* <builtin>:15:24 */
  51. type X__int128_t = struct {
  52. Flo int64
  53. Fhi int64
  54. } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
  55. type X__uint128_t = struct {
  56. Flo uint64
  57. Fhi uint64
  58. } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128
  59. type X__builtin_va_list = uintptr /* <builtin>:46:14 */
  60. type X__float128 = float64 /* <builtin>:47:21 */
  61. // return true if value 'a' fits in type 't'
  62. // $NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  63. // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  64. // Public domain.
  65. //
  66. // NOTE: Do not protect this header against multiple inclusion. Doing
  67. // so can have subtle side-effects due to header file inclusion order
  68. // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE. Instead,
  69. // protect each CPP macro that we want to supply.
  70. // Feature-test macros are defined by several standards, and allow an
  71. // application to specify what symbols they want the system headers to
  72. // expose, and hence what standard they want them to conform to.
  73. // There are two classes of feature-test macros. The first class
  74. // specify complete standards, and if one of these is defined, header
  75. // files will try to conform to the relevant standard. They are:
  76. //
  77. // ANSI macros:
  78. // _ANSI_SOURCE ANSI C89
  79. //
  80. // POSIX macros:
  81. // _POSIX_SOURCE == 1 IEEE Std 1003.1 (version?)
  82. // _POSIX_C_SOURCE == 1 IEEE Std 1003.1-1990
  83. // _POSIX_C_SOURCE == 2 IEEE Std 1003.2-1992
  84. // _POSIX_C_SOURCE == 199309L IEEE Std 1003.1b-1993
  85. // _POSIX_C_SOURCE == 199506L ISO/IEC 9945-1:1996
  86. // _POSIX_C_SOURCE == 200112L IEEE Std 1003.1-2001
  87. // _POSIX_C_SOURCE == 200809L IEEE Std 1003.1-2008
  88. //
  89. // X/Open macros:
  90. // _XOPEN_SOURCE System Interfaces and Headers, Issue 4, Ver 2
  91. // _XOPEN_SOURCE_EXTENDED == 1 XSH4.2 UNIX extensions
  92. // _XOPEN_SOURCE == 500 System Interfaces and Headers, Issue 5
  93. // _XOPEN_SOURCE == 520 Networking Services (XNS), Issue 5.2
  94. // _XOPEN_SOURCE == 600 IEEE Std 1003.1-2001, XSI option
  95. // _XOPEN_SOURCE == 700 IEEE Std 1003.1-2008, XSI option
  96. //
  97. // NetBSD macros:
  98. // _NETBSD_SOURCE == 1 Make all NetBSD features available.
  99. //
  100. // If more than one of these "major" feature-test macros is defined,
  101. // then the set of facilities provided (and namespace used) is the
  102. // union of that specified by the relevant standards, and in case of
  103. // conflict, the earlier standard in the above list has precedence (so
  104. // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  105. // of rename() that's used is the POSIX one). If none of the "major"
  106. // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  107. //
  108. // There are also "minor" feature-test macros, which enable extra
  109. // functionality in addition to some base standard. They should be
  110. // defined along with one of the "major" macros. The "minor" macros
  111. // are:
  112. //
  113. // _REENTRANT
  114. // _ISOC99_SOURCE
  115. // _ISOC11_SOURCE
  116. // _LARGEFILE_SOURCE Large File Support
  117. // <http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  118. // $NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
  119. // -
  120. // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
  121. // All rights reserved.
  122. //
  123. // This code is derived from software contributed to The NetBSD Foundation
  124. // by Jun-ichiro itojun Hagino and by Klaus Klein.
  125. //
  126. // Redistribution and use in source and binary forms, with or without
  127. // modification, are permitted provided that the following conditions
  128. // are met:
  129. // 1. Redistributions of source code must retain the above copyright
  130. // notice, this list of conditions and the following disclaimer.
  131. // 2. Redistributions in binary form must reproduce the above copyright
  132. // notice, this list of conditions and the following disclaimer in the
  133. // documentation and/or other materials provided with the distribution.
  134. //
  135. // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  136. // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  137. // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  138. // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  139. // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  140. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  141. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  142. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  143. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  144. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  145. // POSSIBILITY OF SUCH DAMAGE.
  146. // $NetBSD: ansi.h,v 1.11 2019/05/07 03:49:26 kamil Exp $
  147. // $NetBSD: common_ansi.h,v 1.1 2014/08/19 07:27:31 matt Exp $
  148. // -
  149. // Copyright (c) 2014 The NetBSD Foundation, Inc.
  150. // All rights reserved.
  151. //
  152. // This code is derived from software contributed to The NetBSD Foundation
  153. // by Matt Thomas of 3am Software Foundry.
  154. //
  155. // Redistribution and use in source and binary forms, with or without
  156. // modification, are permitted provided that the following conditions
  157. // are met:
  158. // 1. Redistributions of source code must retain the above copyright
  159. // notice, this list of conditions and the following disclaimer.
  160. // 2. Redistributions in binary form must reproduce the above copyright
  161. // notice, this list of conditions and the following disclaimer in the
  162. // documentation and/or other materials provided with the distribution.
  163. //
  164. // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  165. // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  166. // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  167. // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  168. // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  169. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  170. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  171. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  172. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  173. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  174. // POSSIBILITY OF SUCH DAMAGE.
  175. // $NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  176. // * Copyright (c) 1991, 1993
  177. // The Regents of the University of California. All rights reserved.
  178. //
  179. // This code is derived from software contributed to Berkeley by
  180. // Berkeley Software Design, Inc.
  181. //
  182. // Redistribution and use in source and binary forms, with or without
  183. // modification, are permitted provided that the following conditions
  184. // are met:
  185. // 1. Redistributions of source code must retain the above copyright
  186. // notice, this list of conditions and the following disclaimer.
  187. // 2. Redistributions in binary form must reproduce the above copyright
  188. // notice, this list of conditions and the following disclaimer in the
  189. // documentation and/or other materials provided with the distribution.
  190. // 3. Neither the name of the University nor the names of its contributors
  191. // may be used to endorse or promote products derived from this software
  192. // without specific prior written permission.
  193. //
  194. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  195. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  196. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  197. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  198. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  199. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  200. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  201. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  202. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  203. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  204. // SUCH DAMAGE.
  205. //
  206. // @(#)cdefs.h 8.8 (Berkeley) 1/9/95
  207. // $NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
  208. // -
  209. // Copyright (c) 1990 The Regents of the University of California.
  210. // All rights reserved.
  211. //
  212. // Redistribution and use in source and binary forms, with or without
  213. // modification, are permitted provided that the following conditions
  214. // are met:
  215. // 1. Redistributions of source code must retain the above copyright
  216. // notice, this list of conditions and the following disclaimer.
  217. // 2. Redistributions in binary form must reproduce the above copyright
  218. // notice, this list of conditions and the following disclaimer in the
  219. // documentation and/or other materials provided with the distribution.
  220. // 3. Neither the name of the University nor the names of its contributors
  221. // may be used to endorse or promote products derived from this software
  222. // without specific prior written permission.
  223. //
  224. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  225. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  226. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  227. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  228. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  229. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  230. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  231. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  232. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  233. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  234. // SUCH DAMAGE.
  235. //
  236. // from: @(#)types.h 7.5 (Berkeley) 3/9/91
  237. // $NetBSD: common_int_types.h,v 1.1 2014/07/25 21:43:13 joerg Exp $
  238. // -
  239. // Copyright (c) 2014 The NetBSD Foundation, Inc.
  240. // All rights reserved.
  241. //
  242. // This code is derived from software contributed to The NetBSD Foundation
  243. // by Joerg Sonnenberger.
  244. //
  245. // Redistribution and use in source and binary forms, with or without
  246. // modification, are permitted provided that the following conditions
  247. // are met:
  248. // 1. Redistributions of source code must retain the above copyright
  249. // notice, this list of conditions and the following disclaimer.
  250. // 2. Redistributions in binary form must reproduce the above copyright
  251. // notice, this list of conditions and the following disclaimer in the
  252. // documentation and/or other materials provided with the distribution.
  253. //
  254. // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  255. // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  256. // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  257. // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  258. // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  259. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  260. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  261. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  262. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  263. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  264. // POSSIBILITY OF SUCH DAMAGE.
  265. // 7.18.1 Integer types
  266. // 7.18.1.1 Exact-width integer types
  267. type X__int8_t = int8 /* common_int_types.h:45:27 */
  268. type X__uint8_t = uint8 /* common_int_types.h:46:27 */
  269. type X__int16_t = int16 /* common_int_types.h:47:27 */
  270. type X__uint16_t = uint16 /* common_int_types.h:48:27 */
  271. type X__int32_t = int32 /* common_int_types.h:49:27 */
  272. type X__uint32_t = uint32 /* common_int_types.h:50:27 */
  273. type X__int64_t = int64 /* common_int_types.h:51:27 */
  274. type X__uint64_t = uint64 /* common_int_types.h:52:27 */
  275. // 7.18.1.4 Integer types capable of holding object pointers
  276. type X__intptr_t = int64 /* common_int_types.h:58:27 */
  277. type X__uintptr_t = uint64 /* common_int_types.h:59:26 */
  278. // Types which are fundamental to the implementation and may appear in
  279. // more than one standard header are defined here. Standard headers
  280. // then use:
  281. // #ifdef _BSD_SIZE_T_
  282. // typedef _BSD_SIZE_T_ size_t;
  283. // #undef _BSD_SIZE_T_
  284. // #endif
  285. type X__caddr_t = uintptr /* ansi.h:37:14 */ // core address
  286. type X__gid_t = X__uint32_t /* ansi.h:38:20 */ // group id
  287. type X__in_addr_t = X__uint32_t /* ansi.h:39:20 */ // IP(v4) address
  288. type X__in_port_t = X__uint16_t /* ansi.h:40:20 */ // "Internet" port number
  289. type X__mode_t = X__uint32_t /* ansi.h:41:20 */ // file permissions
  290. type X__off_t = X__int64_t /* ansi.h:42:19 */ // file offset
  291. type X__pid_t = X__int32_t /* ansi.h:43:19 */ // process id
  292. type X__sa_family_t = X__uint8_t /* ansi.h:44:19 */ // socket address family
  293. type X__socklen_t = uint32 /* ansi.h:45:22 */ // socket-related datum length
  294. type X__uid_t = X__uint32_t /* ansi.h:46:20 */ // user id
  295. type X__fsblkcnt_t = X__uint64_t /* ansi.h:47:20 */ // fs block count (statvfs)
  296. type X__fsfilcnt_t = X__uint64_t /* ansi.h:48:20 */
  297. type X__wctrans_t = uintptr /* ansi.h:51:32 */
  298. type X__wctype_t = uintptr /* ansi.h:54:31 */
  299. // mbstate_t is an opaque object to keep conversion state, during multibyte
  300. // stream conversions. The content must not be referenced by user programs.
  301. type X__mbstate_t = struct {
  302. F__mbstateL X__int64_t
  303. F__ccgo_pad1 [120]byte
  304. } /* ansi.h:63:3 */
  305. type X__va_list = X__builtin_va_list /* ansi.h:72:27 */
  306. type Ssize_t = int64 /* stdio.h:49:23 */
  307. // $NetBSD: null.h,v 1.9 2010/07/06 11:56:20 kleink Exp $
  308. // Written by Klaus Klein <kleink@NetBSD.org>, December 22, 1999.
  309. // Public domain.
  310. // This is fairly grotesque, but pure ANSI code must not inspect the
  311. // innards of an fpos_t anyway. The library internally uses off_t,
  312. // which we assume is exactly as big as eight chars.
  313. type X__sfpos = struct {
  314. F_pos X__off_t
  315. F_mbstate_in X__mbstate_t
  316. F_mbstate_out X__mbstate_t
  317. } /* stdio.h:67:9 */
  318. // $NetBSD: null.h,v 1.9 2010/07/06 11:56:20 kleink Exp $
  319. // Written by Klaus Klein <kleink@NetBSD.org>, December 22, 1999.
  320. // Public domain.
  321. // This is fairly grotesque, but pure ANSI code must not inspect the
  322. // innards of an fpos_t anyway. The library internally uses off_t,
  323. // which we assume is exactly as big as eight chars.
  324. type Fpos_t = X__sfpos /* stdio.h:70:3 */
  325. // NB: to fit things in six character monocase externals, the stdio
  326. // code uses the prefix `__s' for stdio objects, typically followed
  327. // by a three-character attempt at a mnemonic.
  328. // stdio buffers
  329. type X__sbuf = struct {
  330. F_base uintptr
  331. F_size int32
  332. F__ccgo_pad1 [4]byte
  333. } /* stdio.h:81:1 */
  334. // stdio state variables.
  335. //
  336. // The following always hold:
  337. //
  338. // if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
  339. // _lbfsize is -_bf._size, else _lbfsize is 0
  340. // if _flags&__SRD, _w is 0
  341. // if _flags&__SWR, _r is 0
  342. //
  343. // This ensures that the getc and putc macros (or inline functions) never
  344. // try to write or read from a file that is in `read' or `write' mode.
  345. // (Moreover, they can, and do, automatically switch from read mode to
  346. // write mode, and back, on "r+" and "w+" files.)
  347. //
  348. // _lbfsize is used only to make the inline line-buffered output stream
  349. // code as compact as possible.
  350. //
  351. // _ub, _up, and _ur are used when ungetc() pushes back more characters
  352. // than fit in the current _bf, or when ungetc() pushes back a character
  353. // that does not match the previous one in _bf. When this happens,
  354. // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  355. // _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  356. //
  357. // NB: see WARNING above before changing the layout of this structure!
  358. type X__sFILE = struct {
  359. F_p uintptr
  360. F_r int32
  361. F_w int32
  362. F_flags uint16
  363. F_file int16
  364. F__ccgo_pad1 [4]byte
  365. F_bf struct {
  366. F_base uintptr
  367. F_size int32
  368. F__ccgo_pad1 [4]byte
  369. }
  370. F_lbfsize int32
  371. F__ccgo_pad2 [4]byte
  372. F_cookie uintptr
  373. F_close uintptr
  374. F_read uintptr
  375. F_seek uintptr
  376. F_write uintptr
  377. F_ext struct {
  378. F_base uintptr
  379. F_size int32
  380. F__ccgo_pad1 [4]byte
  381. }
  382. F_up uintptr
  383. F_ur int32
  384. F_ubuf [3]uint8
  385. F_nbuf [1]uint8
  386. F_flush uintptr
  387. F_lb_unused [8]int8
  388. F_blksize int32
  389. F__ccgo_pad3 [4]byte
  390. F_offset X__off_t
  391. } /* stdio.h:112:9 */
  392. // stdio state variables.
  393. //
  394. // The following always hold:
  395. //
  396. // if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
  397. // _lbfsize is -_bf._size, else _lbfsize is 0
  398. // if _flags&__SRD, _w is 0
  399. // if _flags&__SWR, _r is 0
  400. //
  401. // This ensures that the getc and putc macros (or inline functions) never
  402. // try to write or read from a file that is in `read' or `write' mode.
  403. // (Moreover, they can, and do, automatically switch from read mode to
  404. // write mode, and back, on "r+" and "w+" files.)
  405. //
  406. // _lbfsize is used only to make the inline line-buffered output stream
  407. // code as compact as possible.
  408. //
  409. // _ub, _up, and _ur are used when ungetc() pushes back more characters
  410. // than fit in the current _bf, or when ungetc() pushes back a character
  411. // that does not match the previous one in _bf. When this happens,
  412. // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  413. // _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  414. //
  415. // NB: see WARNING above before changing the layout of this structure!
  416. type FILE = X__sFILE /* stdio.h:146:3 */
  417. // X/Open CAE Specification Issue 5 Version 2
  418. type Off_t = X__off_t /* stdio.h:376:18 */
  419. type Locale_t = uintptr /* stdio.h:543:25 */
  420. var _ int8 /* gen.c:2:13: */