cctools
Functions
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. More...
 
struct jxjx_binary_read (FILE *stream)
 Read a JX expression from a file in binary form. More...
 

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

int jx_binary_write ( FILE *  stream,
struct jx j 
)

Write a JX expression to a file in binary form.

Parameters
streamThe stdio stream to write to.
jThe expression to write.
Returns
True on success, false on failure.
struct jx* jx_binary_read ( FILE *  stream)

Read a JX expression from a file in binary form.

Parameters
streamThe stdio stream to read from.
Returns
A JX expression, or null on failure.