jx_binary.h File Reference

Binary format encode/decode for JX expressions. More...

`#include <stdio.h>`
`#include "jx.h"`

Go to the source code of this file.

## Functions

int | jx_binary_write (FILE *stream, struct jx *j)
| Write a JX expression to a file in binary form.
struct jx * | jx_binary_read (FILE *stream)
| Read a JX expression from a file in binary form.

## Detailed Description

Binary format encode/decode for JX expressions.

These routines allow for JX expressions to be read/written from disk in a custom binary format that is more efficient than traditional parsing of ASCII data. It does not conform to an external standard, and so should only be used for efficient internal storage.

## Function Documentation

## jx_binary_write()

int jx_binary_write | ( | FILE * | stream,
|  | struct jx * | j )

Write a JX expression to a file in binary form.

Parameters

  stream | The stdio stream to write to.
  j | The expression to write.

Returns
  True on success, false on failure.

## jx_binary_read()

struct jx * jx_binary_read | ( | FILE * | stream | ) |

Read a JX expression from a file in binary form.

Parameters

  stream | The stdio stream to read from.

Returns
  A JX expression, or null on failure.