package cstruct

  1. Overview
  2. Docs
access C structures via a camlp4 extension

Install

Dune Dependency

Authors

Maintainers

Sources

v2.4.1.tar.gz
sha256=f3c1600e85eb93a58c052e2e9575b48d4dd02784d9b2615dadf861860afa1ee7
md5=e058a3db193f5fd4706db62a19ed3b98

Description

Cstruct is a library and syntax extension to make it easier to access C-like structures directly from OCaml. It supports both reading and writing to these structures, and they are accessed via the Bigarray module.

An example pcap description using PPX extension points is:

[%%cstruct
type pcap_header = {
  magic_number: uint32_t;   (* magic number *)
  version_major: uint16_t;  (* major version number *)
  version_minor: uint16_t;  (* minor version number *)
  thiszone: uint32_t;       (* GMT to local correction *)
  sigfigs: uint32_t;        (* accuracy of timestamps *)
  snaplen: uint32_t;        (* max length of captured packets, in octets *)
  network: uint32_t;        (* data link type *)
} [@@little_endian]]

For Camlp4 support, please use a version of Cstruct that is <=1.9.0

Dependencies (9)

  1. conf-time
  2. ppx_tools_versioned >= "5.0beta"
  3. ocaml-migrate-parsetree < "2.0.0"
  4. base-bytes
  5. sexplib
  6. ocplib-endian
  7. ocamlbuild build & != "0.9.0"
  8. ocamlfind build
  9. ocaml >= "4.02.3" & < "4.08.0"

Dev Dependencies (1)

  1. ounit with-test

  1. albatross < "1.3.0"
  2. angstrom < "0.7.0"
  3. arakoon >= "1.8.6" & < "1.8.12"
  4. arp < "3.0.0"
  5. arp-mirage
  6. asn1-combinators >= "0.1.2" & != "0.2.0-1" & < "0.2.6"
  7. awa-mirage < "0.0.2"
  8. balancer
  9. buffer-pool
  10. capnp-rpc-net >= "1.1" & < "1.2.1"
  11. channel
  12. charrua-client < "0.9"
  13. charrua-core >= "0.3" & < "0.8"
  14. charrua-unix = "0.6"
  15. cohttp >= "0.9.7" & < "0.10.0"
  16. conduit >= "0.6.0" & < "0.15.2"
  17. conduit-async = "3.0.0"
  18. conduit-lwt = "3.0.0"
  19. conex < "0.10.0"
  20. conex-mirage-crypto
  21. conex-nocrypto
  22. cowabloga >= "0.0.5"
  23. crc
  24. crunch >= "2.0.0" & < "3.0.0"
  25. cstruct-lwt < "3.0.0"
  26. cstruct-unix < "3.0.0"
  27. datakit
  28. datakit-ci >= "0.10.0" & < "0.12.4"
  29. datakit-client
  30. datakit-client-9p
  31. datakit-server
  32. depyt
  33. dns >= "0.18.0" & < "1.0.0"
  34. dns-forward < "0.9.0"
  35. dnssd
  36. dream < "1.0.0~alpha2"
  37. duff < "0.3"
  38. eqaf >= "0.8"
  39. fat-filesystem >= "0.10.0" & < "0.12.1"
  40. frenetic < "2.0.0" | >= "3.2.0" & < "5.0.5"
  41. git >= "1.4.3" & < "1.6.0" | >= "2.0.0" & < "3.0.0"
  42. git-http < "1.11.0"
  43. git-mirage = "1.11.0"
  44. github-hooks >= "0.2.0"
  45. gluten-mirage < "0.3.0"
  46. gpt
  47. h2-mirage
  48. hacl-star >= "0.7.0"
  49. hex >= "0.2.0"
  50. hkdf < "1.0.3"
  51. httpun-mirage
  52. httpun-ws-mirage
  53. hvsock < "3.0.0"
  54. io-page
  55. io-page-unix
  56. io-page-xen
  57. ipaddr-cstruct < "5.2.0"
  58. irmin >= "0.9.0" & < "2.0.0"
  59. irmin-git >= "2.3.0"
  60. irmin-indexeddb >= "0.3"
  61. key-parsers >= "0.5.0" & < "1.2.1"
  62. launchd
  63. letsencrypt = "0.2.5"
  64. letsencrypt-app < "0.4.0"
  65. macaddr-cstruct < "5.2.0"
  66. metrics-mirage
  67. mirage >= "0.7.2" & < "0.9.0" | >= "0.10.0" & < "2.4.0"
  68. mirage-block < "1.0.0"
  69. mirage-block-ccm < "1.1.0"
  70. mirage-block-combinators < "3.0.0"
  71. mirage-block-lwt
  72. mirage-block-ramdisk
  73. mirage-block-solo5 < "0.6.2"
  74. mirage-block-unix < "2.8.3"
  75. mirage-block-xen >= "1.4.0" & < "2.1.1"
  76. mirage-btrees
  77. mirage-channel-lwt
  78. mirage-clock-unix < "1.0.0"
  79. mirage-clock-xen < "1.0.0"
  80. mirage-conduit = "2.3.1"
  81. mirage-console-lwt
  82. mirage-console-solo5 >= "0.2.0"
  83. mirage-console-unix < "2.3.3"
  84. mirage-console-xen = "4.0.0"
  85. mirage-console-xen-backend >= "2.3.2" & < "2.3.4" | = "4.0.0"
  86. mirage-console-xen-cli
  87. mirage-dns != "2.6.0" & < "2.7.0"
  88. mirage-entropy < "0.5.0"
  89. mirage-entropy-unix
  90. mirage-entropy-xen
  91. mirage-flow < "1.2.0"
  92. mirage-flow-lwt
  93. mirage-flow-rawlink >= "1.1.0"
  94. mirage-flow-unix < "1.5.0"
  95. mirage-fs >= "0.4.0" & < "1.0.0"
  96. mirage-fs-lwt
  97. mirage-fs-mem
  98. mirage-fs-unix < "1.4.1"
  99. mirage-kv-lwt
  100. mirage-nat < "2.2.4"
  101. mirage-net = "0.5.2"
  102. mirage-net-fd < "0.2.1"
  103. mirage-net-lwt
  104. mirage-net-macosx
  105. mirage-net-solo5
  106. mirage-net-unix < "2.1.0" | >= "2.2.1" & != "2.4.1"
  107. mirage-net-xen != "1.4.2" & < "1.7.1"
  108. mirage-profile = "0.7.0"
  109. mirage-protocols-lwt
  110. mirage-qubes != "0.2" & < "0.9.2"
  111. mirage-qubes-ipv4 < "0.9.3"
  112. mirage-random < "2.0.0"
  113. mirage-random-stdlib
  114. mirage-random-test
  115. mirage-solo5
  116. mirage-stack-lwt
  117. mirage-tc
  118. mirage-tcpip-unix
  119. mirage-tcpip-xen
  120. mirage-types-lwt < "3.4.0"
  121. mirage-unix < "0.9.4" | >= "2.5.0" & < "3.0.8"
  122. mirage-vnetif < "0.6.0"
  123. mirage-www < "0.4.0" | >= "1.1.0"
  124. mirage-xen < "2.0.0" | >= "2.6.0"
  125. monorobot
  126. mrt-format
  127. mstruct
  128. nbd >= "2.1.0" & < "4.0.3"
  129. nocrypto < "0.5.4-1"
  130. noise
  131. openflow < "0.2.0"
  132. otr >= "0.3.1" & < "0.3.9"
  133. ox < "1.1.1"
  134. pbkdf < "0.3.0" | = "1.1.0"
  135. pcap-format >= "0.4.0"
  136. ppx_cstruct < "3.0.1"
  137. protocol-9p < "0.5.1" | >= "0.6.0" & < "0.11.2"
  138. protocol-9p-tool = "0.12.0" | >= "2.0.0" & < "2.0.2"
  139. protocol-9p-unix < "0.11.2"
  140. qcow < "0.11.0"
  141. qcow-format
  142. qcow-tool
  143. randomconv < "0.2.0"
  144. rawlink >= "0.4" & < "0.6"
  145. resp-mirage = "0.10.0"
  146. rfc6287 >= "1.0.2" & < "1.0.4"
  147. salsa20 < "1.1.0"
  148. salsa20-core < "1.0.0"
  149. scrypt-kdf < "1.1.0"
  150. sendmail >= "0.4.1" & < "0.5.0"
  151. shared-block-ring < "2.4.0"
  152. shared-memory-ring >= "1.2.0" & < "3.1.1"
  153. shared-memory-ring-lwt
  154. slack
  155. ssh-agent
  156. tar < "2.0.0"
  157. tar-format >= "0.5.0"
  158. tar-mirage
  159. tar-unix < "2.0.0"
  160. tcpip < "2.3.0" | >= "2.7.0" & < "3.2.0"
  161. tls >= "0.7.1" & < "0.9.0"
  162. u2f = "0.1.1"
  163. vchan >= "2.1.0" & != "3.0.0" & < "6.0.1"
  164. vchan-unix >= "4.0.0"
  165. vchan-xen >= "4.0.0"
  166. vhd-format >= "0.8.0"
  167. vhd-format-lwt
  168. vhd-tool
  169. vmnet >= "1.1.0"
  170. websocket = "2.2"
  171. x509 < "0.6.3"
  172. xapi-rrd-transport
  173. xe
  174. xen-api-client >= "0.9.6"
  175. xen-block-driver >= "0.2.5"
  176. xen-gnt
  177. xenstore >= "1.3.0" & < "2.0.0"

Conflicts (1)

  1. async >= "v0.10.0"
OCaml

Innovation. Community. Security.