bindings.rs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. /* automatically generated by rust-bindgen 0.55.1 */
  2. extern "C" {
  3. pub fn Assert_failure(format: *const ::std::os::raw::c_char, ...);
  4. }
  5. pub type Allocator_OnFreeCallback = ::std::option::Option<
  6. unsafe extern "C" fn(job: *mut Allocator_OnFreeJob) -> ::std::os::raw::c_int,
  7. >;
  8. #[repr(C)]
  9. #[derive(Debug, Copy, Clone)]
  10. pub struct Allocator_OnFreeJob {
  11. pub callback: Allocator_OnFreeCallback,
  12. pub userData: *mut ::std::os::raw::c_void,
  13. }
  14. #[test]
  15. fn bindgen_test_layout_Allocator_OnFreeJob() {
  16. assert_eq!(
  17. ::std::mem::size_of::<Allocator_OnFreeJob>(),
  18. 16usize,
  19. concat!("Size of: ", stringify!(Allocator_OnFreeJob))
  20. );
  21. assert_eq!(
  22. ::std::mem::align_of::<Allocator_OnFreeJob>(),
  23. 8usize,
  24. concat!("Alignment of ", stringify!(Allocator_OnFreeJob))
  25. );
  26. assert_eq!(
  27. unsafe { &(*(::std::ptr::null::<Allocator_OnFreeJob>())).callback as *const _ as usize },
  28. 0usize,
  29. concat!(
  30. "Offset of field: ",
  31. stringify!(Allocator_OnFreeJob),
  32. "::",
  33. stringify!(callback)
  34. )
  35. );
  36. assert_eq!(
  37. unsafe { &(*(::std::ptr::null::<Allocator_OnFreeJob>())).userData as *const _ as usize },
  38. 8usize,
  39. concat!(
  40. "Offset of field: ",
  41. stringify!(Allocator_OnFreeJob),
  42. "::",
  43. stringify!(userData)
  44. )
  45. );
  46. }
  47. #[repr(C)]
  48. #[derive(Debug, Copy, Clone)]
  49. pub struct Allocator {
  50. pub fileName: *const ::std::os::raw::c_char,
  51. pub lineNum: ::std::os::raw::c_int,
  52. pub isFreeing: ::std::os::raw::c_int,
  53. }
  54. #[test]
  55. fn bindgen_test_layout_Allocator() {
  56. assert_eq!(
  57. ::std::mem::size_of::<Allocator>(),
  58. 16usize,
  59. concat!("Size of: ", stringify!(Allocator))
  60. );
  61. assert_eq!(
  62. ::std::mem::align_of::<Allocator>(),
  63. 8usize,
  64. concat!("Alignment of ", stringify!(Allocator))
  65. );
  66. assert_eq!(
  67. unsafe { &(*(::std::ptr::null::<Allocator>())).fileName as *const _ as usize },
  68. 0usize,
  69. concat!(
  70. "Offset of field: ",
  71. stringify!(Allocator),
  72. "::",
  73. stringify!(fileName)
  74. )
  75. );
  76. assert_eq!(
  77. unsafe { &(*(::std::ptr::null::<Allocator>())).lineNum as *const _ as usize },
  78. 8usize,
  79. concat!(
  80. "Offset of field: ",
  81. stringify!(Allocator),
  82. "::",
  83. stringify!(lineNum)
  84. )
  85. );
  86. assert_eq!(
  87. unsafe { &(*(::std::ptr::null::<Allocator>())).isFreeing as *const _ as usize },
  88. 12usize,
  89. concat!(
  90. "Offset of field: ",
  91. stringify!(Allocator),
  92. "::",
  93. stringify!(isFreeing)
  94. )
  95. );
  96. }
  97. #[repr(C)]
  98. #[derive(Debug, Copy, Clone)]
  99. pub struct Allocator_Allocation {
  100. pub size: usize,
  101. }
  102. #[test]
  103. fn bindgen_test_layout_Allocator_Allocation() {
  104. assert_eq!(
  105. ::std::mem::size_of::<Allocator_Allocation>(),
  106. 8usize,
  107. concat!("Size of: ", stringify!(Allocator_Allocation))
  108. );
  109. assert_eq!(
  110. ::std::mem::align_of::<Allocator_Allocation>(),
  111. 8usize,
  112. concat!("Alignment of ", stringify!(Allocator_Allocation))
  113. );
  114. assert_eq!(
  115. unsafe { &(*(::std::ptr::null::<Allocator_Allocation>())).size as *const _ as usize },
  116. 0usize,
  117. concat!(
  118. "Offset of field: ",
  119. stringify!(Allocator_Allocation),
  120. "::",
  121. stringify!(size)
  122. )
  123. );
  124. }
  125. extern "C" {
  126. pub fn Allocator_getChild(
  127. alloc: *mut Allocator,
  128. childNumber: ::std::os::raw::c_int,
  129. ) -> *mut Allocator;
  130. }
  131. extern "C" {
  132. pub fn Allocator_getAllocation(
  133. alloc: *mut Allocator,
  134. allocNum: ::std::os::raw::c_int,
  135. ) -> *mut Allocator_Allocation;
  136. }
  137. extern "C" {
  138. pub fn Allocator__malloc(
  139. allocator: *mut Allocator,
  140. length: ::std::os::raw::c_ulong,
  141. fileName: *const ::std::os::raw::c_char,
  142. lineNum: ::std::os::raw::c_int,
  143. ) -> *mut ::std::os::raw::c_void;
  144. }
  145. extern "C" {
  146. pub fn Allocator__calloc(
  147. alloc: *mut Allocator,
  148. length: ::std::os::raw::c_ulong,
  149. count: ::std::os::raw::c_ulong,
  150. fileName: *const ::std::os::raw::c_char,
  151. lineNum: ::std::os::raw::c_int,
  152. ) -> *mut ::std::os::raw::c_void;
  153. }
  154. extern "C" {
  155. pub fn Allocator__realloc(
  156. allocator: *mut Allocator,
  157. original: *const ::std::os::raw::c_void,
  158. size: ::std::os::raw::c_ulong,
  159. fileName: *const ::std::os::raw::c_char,
  160. lineNum: ::std::os::raw::c_int,
  161. ) -> *mut ::std::os::raw::c_void;
  162. }
  163. extern "C" {
  164. pub fn Allocator__clone(
  165. allocator: *mut Allocator,
  166. toClone: *const ::std::os::raw::c_void,
  167. length: ::std::os::raw::c_ulong,
  168. fileName: *const ::std::os::raw::c_char,
  169. lineNum: ::std::os::raw::c_int,
  170. ) -> *mut ::std::os::raw::c_void;
  171. }
  172. extern "C" {
  173. pub fn Allocator__child(
  174. alloc: *mut Allocator,
  175. fileName: *const ::std::os::raw::c_char,
  176. lineNum: ::std::os::raw::c_int,
  177. ) -> *mut Allocator;
  178. }
  179. extern "C" {
  180. pub fn Allocator__free(
  181. alloc: *mut Allocator,
  182. file: *const ::std::os::raw::c_char,
  183. line: ::std::os::raw::c_int,
  184. );
  185. }
  186. extern "C" {
  187. pub fn Allocator__onFree(
  188. alloc: *mut Allocator,
  189. callback: Allocator_OnFreeCallback,
  190. context: *mut ::std::os::raw::c_void,
  191. file: *const ::std::os::raw::c_char,
  192. line: ::std::os::raw::c_int,
  193. ) -> *mut Allocator_OnFreeJob;
  194. }
  195. extern "C" {
  196. pub fn Allocator_cancelOnFree(toRemove: *mut Allocator_OnFreeJob) -> ::std::os::raw::c_int;
  197. }
  198. extern "C" {
  199. pub fn Allocator_onFreeComplete(onFreeJob: *mut Allocator_OnFreeJob);
  200. }
  201. extern "C" {
  202. pub fn Allocator__adopt(
  203. parentAlloc: *mut Allocator,
  204. alloc: *mut Allocator,
  205. fileName: *const ::std::os::raw::c_char,
  206. lineNum: ::std::os::raw::c_int,
  207. );
  208. }
  209. extern "C" {
  210. pub fn Allocator__disown(
  211. parentAlloc: *mut Allocator,
  212. allocToDisown: *mut Allocator,
  213. fileName: *const ::std::os::raw::c_char,
  214. lineNum: ::std::os::raw::c_int,
  215. );
  216. }
  217. extern "C" {
  218. pub fn Allocator_setCanary(alloc: *mut Allocator, value: usize);
  219. }
  220. extern "C" {
  221. pub fn Allocator_bytesAllocated(allocator: *mut Allocator) -> ::std::os::raw::c_ulong;
  222. }
  223. extern "C" {
  224. pub fn Allocator_snapshot(alloc: *mut Allocator, includeAllocations: ::std::os::raw::c_int);
  225. }
  226. pub type Allocator_Provider = ::std::option::Option<
  227. unsafe extern "C" fn(
  228. ctx: *mut ::std::os::raw::c_void,
  229. original: *mut Allocator_Allocation,
  230. size: ::std::os::raw::c_ulong,
  231. group: *mut Allocator,
  232. ) -> *mut ::std::os::raw::c_void,
  233. >;
  234. extern "C" {
  235. pub fn Allocator_new(
  236. sizeLimit: ::std::os::raw::c_ulong,
  237. provider: Allocator_Provider,
  238. providerContext: *mut ::std::os::raw::c_void,
  239. fileName: *const ::std::os::raw::c_char,
  240. lineNum: ::std::os::raw::c_int,
  241. ) -> *mut Allocator;
  242. }
  243. pub const Error_e_Error_NONE: Error_e = 0;
  244. pub const Error_e_Error_MALFORMED_ADDRESS: Error_e = 1;
  245. pub const Error_e_Error_FLOOD: Error_e = 2;
  246. pub const Error_e_Error_LINK_LIMIT_EXCEEDED: Error_e = 3;
  247. pub const Error_e_Error_OVERSIZE_MESSAGE: Error_e = 4;
  248. pub const Error_e_Error_RUNT: Error_e = 5;
  249. pub const Error_e_Error_AUTHENTICATION: Error_e = 6;
  250. pub const Error_e_Error_INVALID: Error_e = 7;
  251. pub const Error_e_Error_UNDELIVERABLE: Error_e = 8;
  252. pub const Error_e_Error_LOOP_ROUTE: Error_e = 9;
  253. pub const Error_e_Error_RETURN_PATH_INVALID: Error_e = 10;
  254. pub const Error_e_Error_UNHANDLED: Error_e = 11;
  255. pub const Error_e_Error_OVERFLOW: Error_e = 12;
  256. pub const Error_e_Error_INTERNAL: Error_e = 13;
  257. pub type Error_e = ::std::os::raw::c_uint;
  258. #[repr(C)]
  259. #[derive(Debug, Copy, Clone)]
  260. pub struct Error_s {
  261. pub e: Error_e,
  262. }
  263. #[test]
  264. fn bindgen_test_layout_Error_s() {
  265. assert_eq!(
  266. ::std::mem::size_of::<Error_s>(),
  267. 4usize,
  268. concat!("Size of: ", stringify!(Error_s))
  269. );
  270. assert_eq!(
  271. ::std::mem::align_of::<Error_s>(),
  272. 4usize,
  273. concat!("Alignment of ", stringify!(Error_s))
  274. );
  275. assert_eq!(
  276. unsafe { &(*(::std::ptr::null::<Error_s>())).e as *const _ as usize },
  277. 0usize,
  278. concat!(
  279. "Offset of field: ",
  280. stringify!(Error_s),
  281. "::",
  282. stringify!(e)
  283. )
  284. );
  285. }
  286. #[repr(C)]
  287. #[derive(Debug, Copy, Clone)]
  288. pub struct Er_Ret {
  289. pub message: *const ::std::os::raw::c_char,
  290. }
  291. #[test]
  292. fn bindgen_test_layout_Er_Ret() {
  293. assert_eq!(
  294. ::std::mem::size_of::<Er_Ret>(),
  295. 8usize,
  296. concat!("Size of: ", stringify!(Er_Ret))
  297. );
  298. assert_eq!(
  299. ::std::mem::align_of::<Er_Ret>(),
  300. 8usize,
  301. concat!("Alignment of ", stringify!(Er_Ret))
  302. );
  303. assert_eq!(
  304. unsafe { &(*(::std::ptr::null::<Er_Ret>())).message as *const _ as usize },
  305. 0usize,
  306. concat!(
  307. "Offset of field: ",
  308. stringify!(Er_Ret),
  309. "::",
  310. stringify!(message)
  311. )
  312. );
  313. }
  314. extern "C" {
  315. pub fn Er__raise(
  316. file: *mut ::std::os::raw::c_char,
  317. line: ::std::os::raw::c_int,
  318. alloc: *mut Allocator,
  319. format: *mut ::std::os::raw::c_char,
  320. ...
  321. ) -> *mut Er_Ret;
  322. }
  323. extern "C" {
  324. pub fn Er__assertFail(er: *mut Er_Ret);
  325. }
  326. pub type size_t = ::std::os::raw::c_ulong;
  327. pub type wchar_t = ::std::os::raw::c_int;
  328. extern "C" {
  329. pub fn Bits_log2x64_stupid(number: u64) -> ::std::os::raw::c_int;
  330. }
  331. extern "C" {
  332. pub fn Bits_memmem(
  333. haystack: *const ::std::os::raw::c_void,
  334. haystackLen: size_t,
  335. needle: *const ::std::os::raw::c_void,
  336. needleLen: size_t,
  337. ) -> *mut ::std::os::raw::c_void;
  338. }
  339. #[repr(C)]
  340. #[derive(Debug, Copy, Clone)]
  341. pub struct Message {
  342. pub length: i32,
  343. pub padding: i32,
  344. pub bytes: *mut u8,
  345. pub capacity: i32,
  346. pub associatedFd: ::std::os::raw::c_int,
  347. pub currentIface: *mut Iface,
  348. pub alloc: *mut Allocator,
  349. }
  350. #[test]
  351. fn bindgen_test_layout_Message() {
  352. assert_eq!(
  353. ::std::mem::size_of::<Message>(),
  354. 40usize,
  355. concat!("Size of: ", stringify!(Message))
  356. );
  357. assert_eq!(
  358. ::std::mem::align_of::<Message>(),
  359. 8usize,
  360. concat!("Alignment of ", stringify!(Message))
  361. );
  362. assert_eq!(
  363. unsafe { &(*(::std::ptr::null::<Message>())).length as *const _ as usize },
  364. 0usize,
  365. concat!(
  366. "Offset of field: ",
  367. stringify!(Message),
  368. "::",
  369. stringify!(length)
  370. )
  371. );
  372. assert_eq!(
  373. unsafe { &(*(::std::ptr::null::<Message>())).padding as *const _ as usize },
  374. 4usize,
  375. concat!(
  376. "Offset of field: ",
  377. stringify!(Message),
  378. "::",
  379. stringify!(padding)
  380. )
  381. );
  382. assert_eq!(
  383. unsafe { &(*(::std::ptr::null::<Message>())).bytes as *const _ as usize },
  384. 8usize,
  385. concat!(
  386. "Offset of field: ",
  387. stringify!(Message),
  388. "::",
  389. stringify!(bytes)
  390. )
  391. );
  392. assert_eq!(
  393. unsafe { &(*(::std::ptr::null::<Message>())).capacity as *const _ as usize },
  394. 16usize,
  395. concat!(
  396. "Offset of field: ",
  397. stringify!(Message),
  398. "::",
  399. stringify!(capacity)
  400. )
  401. );
  402. assert_eq!(
  403. unsafe { &(*(::std::ptr::null::<Message>())).associatedFd as *const _ as usize },
  404. 20usize,
  405. concat!(
  406. "Offset of field: ",
  407. stringify!(Message),
  408. "::",
  409. stringify!(associatedFd)
  410. )
  411. );
  412. assert_eq!(
  413. unsafe { &(*(::std::ptr::null::<Message>())).currentIface as *const _ as usize },
  414. 24usize,
  415. concat!(
  416. "Offset of field: ",
  417. stringify!(Message),
  418. "::",
  419. stringify!(currentIface)
  420. )
  421. );
  422. assert_eq!(
  423. unsafe { &(*(::std::ptr::null::<Message>())).alloc as *const _ as usize },
  424. 32usize,
  425. concat!(
  426. "Offset of field: ",
  427. stringify!(Message),
  428. "::",
  429. stringify!(alloc)
  430. )
  431. );
  432. }
  433. extern "C" {
  434. pub fn Message_new(
  435. messageLength: u32,
  436. amountOfPadding: u32,
  437. alloc: *mut Allocator,
  438. ) -> *mut Message;
  439. }
  440. extern "C" {
  441. pub fn Message_setAssociatedFd(msg: *mut Message, fd: ::std::os::raw::c_int);
  442. }
  443. extern "C" {
  444. pub fn Message_getAssociatedFd(msg: *mut Message) -> ::std::os::raw::c_int;
  445. }
  446. extern "C" {
  447. pub fn Message_clone(toClone: *mut Message, alloc: *mut Allocator) -> *mut Message;
  448. }
  449. extern "C" {
  450. pub fn Message_copyOver(output: *mut Message, input: *mut Message, allocator: *mut Allocator);
  451. }
  452. pub type Iface_Callback = ::std::option::Option<
  453. unsafe extern "C" fn(message: *mut Message, thisInterface: *mut Iface) -> Error_s,
  454. >;
  455. #[repr(C)]
  456. #[derive(Debug, Copy, Clone)]
  457. pub struct Iface {
  458. pub send: Iface_Callback,
  459. pub currentMsg: *mut Message,
  460. pub connectedIf: *mut Iface,
  461. }
  462. #[test]
  463. fn bindgen_test_layout_Iface() {
  464. assert_eq!(
  465. ::std::mem::size_of::<Iface>(),
  466. 24usize,
  467. concat!("Size of: ", stringify!(Iface))
  468. );
  469. assert_eq!(
  470. ::std::mem::align_of::<Iface>(),
  471. 8usize,
  472. concat!("Alignment of ", stringify!(Iface))
  473. );
  474. assert_eq!(
  475. unsafe { &(*(::std::ptr::null::<Iface>())).send as *const _ as usize },
  476. 0usize,
  477. concat!(
  478. "Offset of field: ",
  479. stringify!(Iface),
  480. "::",
  481. stringify!(send)
  482. )
  483. );
  484. assert_eq!(
  485. unsafe { &(*(::std::ptr::null::<Iface>())).currentMsg as *const _ as usize },
  486. 8usize,
  487. concat!(
  488. "Offset of field: ",
  489. stringify!(Iface),
  490. "::",
  491. stringify!(currentMsg)
  492. )
  493. );
  494. assert_eq!(
  495. unsafe { &(*(::std::ptr::null::<Iface>())).connectedIf as *const _ as usize },
  496. 16usize,
  497. concat!(
  498. "Offset of field: ",
  499. stringify!(Iface),
  500. "::",
  501. stringify!(connectedIf)
  502. )
  503. );
  504. }
  505. #[repr(C)]
  506. #[derive(Debug, Copy, Clone)]
  507. pub struct CCountWrapper {
  508. pub internal: *mut Iface,
  509. pub external: *mut Iface,
  510. }
  511. #[test]
  512. fn bindgen_test_layout_CCountWrapper() {
  513. assert_eq!(
  514. ::std::mem::size_of::<CCountWrapper>(),
  515. 16usize,
  516. concat!("Size of: ", stringify!(CCountWrapper))
  517. );
  518. assert_eq!(
  519. ::std::mem::align_of::<CCountWrapper>(),
  520. 8usize,
  521. concat!("Alignment of ", stringify!(CCountWrapper))
  522. );
  523. assert_eq!(
  524. unsafe { &(*(::std::ptr::null::<CCountWrapper>())).internal as *const _ as usize },
  525. 0usize,
  526. concat!(
  527. "Offset of field: ",
  528. stringify!(CCountWrapper),
  529. "::",
  530. stringify!(internal)
  531. )
  532. );
  533. assert_eq!(
  534. unsafe { &(*(::std::ptr::null::<CCountWrapper>())).external as *const _ as usize },
  535. 8usize,
  536. concat!(
  537. "Offset of field: ",
  538. stringify!(CCountWrapper),
  539. "::",
  540. stringify!(external)
  541. )
  542. );
  543. }
  544. extern "C" {
  545. pub fn countwrapper_create(alloc: *mut Allocator) -> CCountWrapper;
  546. }