package ppx_blob

  1. Overview
  2. Docs
Include a file as a string at compile time

Install

Dune Dependency

Authors

Maintainers

Sources

ppx_blob-0.7.0.tbz
sha256=ac8a35f7966f7a8b7cf5d2ecde8ca6bfb3e98e420ee55ad066311b2861d31c65
sha512=6fb3e272540d790cd26d73f531c6dc2118e800f50aa85def5e2e9bf71e06a3b92ea0b0c77210e4d69e2e21acfca5707ccde5d5d5f609819299df54253bef60db

Description

ppx_blob allows you to include a binary blob from a file as a string. Writing [%blob "filename"] will replace the string with the contents of the file at compile time. This allows the inclusion of arbitary, possibly compressed, data, without the need to respect OCaml's lexical conventions.

Published: 24 Mar 2020

README

ppx_blob

OCaml ppx to include a binary blob from a file as a string. Writing [%blob "filename"] will replace the string with the contents of the file at compile time. This allows the inclusion of arbitary, possibly compressed, data, without the need to respect OCaml's lexical conventions.

The filename can be relative to either the source file where [%blob] appears, or relative to the current working directory. If both files exist, the former takes precedence.

To build

Requires OCaml 4.02 or above.

Run make in the top directory. Then run make in the examples directory. Now run the quine executable.

To install

Run make install in the top directory once make has been run.

Integration with build systems

dune

Add (preprocessor_deps filename) to your filename stanza. See https://github.com/johnwhitington/ppx_blob/tree/master/test for an example. This will make sure the file is copied to the build directory and therefore visible to ppx_blob.

Dev Dependencies (1)

  1. alcotest with-test

Used by (13)

  1. electrod < "0.1.6"
  2. goblint >= "2.0.0" & < "2.2.1"
  3. hacl_x25519
  4. jsoo-react
  5. ketrew < "2.0.0"
  6. key-parsers >= "0.3.0" & < "0.8.1"
  7. memgraph_kitty
  8. ogen >= "0.1.2"
  9. passmaker
  10. stog >= "0.15.0" & < "0.19.0"
  11. u2f
  12. webauthn
  13. zanuda

Conflicts

None

OCaml

Innovation. Community. Security.