Files
revng-revng/docs/mime_handling.md
Giacomo Vercesi 8a780a58aa GraphQL: return binaries in b64
This change fixes the pipeline behavior when producing targets:
* produce and extract now return rp_buffer, which has a start pointer
  and size
* the python api `revng.api` will return on produce/extract either str
  or  bytes depending on the mime type of the container
* the GraphQL api will encode bytes in base64
2023-02-07 16:54:35 +01:00

1.1 KiB

MIME types

  • MIMEs describe the content of the container in its entirety (not what's contained within)

  • Trying to conform as close as possible to RFC2045 and RFC6838

  • Types:

    • text/*: the output will be opened in a text editor
    • everything else: the output needs to be managed by an "external application"
  • Base MIMEs:

    • Built-in MIMEs:
      • application/x-executable -> a binary
      • application/x-object -> an object file
      • text/plain -> Plain text file
    • Custom MIMEs:
      • text/x.c -> C
      • text/x.asm -> Assembly
      • text/x.yaml -> Plain YAML
      • image/svg -> svg
      • text/x.llvm.ir -> LLVM IR
      • application/x.llvm.bc -> LLVM Bitcode

    Mimes that are not text/* or image/svg will be transmitted over GraphQL via Base64 encoding

  • Suffixes (order matters):

    • +ptml LHS is wrapped in PTML
    • +yaml LHS is wrapped in a YAML dictionary with keys being functions metaaddresses (soon: locations)