cctools
Functions
jx_canonicalize.h File Reference

Print a JX structure in canonical form. More...

#include <stdio.h>
#include <stdbool.h>
#include "jx.h"
#include "link.h"
#include "buffer.h"

Go to the source code of this file.

Functions

char * jx_canonicalize (struct jx *j)
 Canonicalize a JX expression to a string. More...
 

Detailed Description

Print a JX structure in canonical form.

Canonical form is not particularly readable, e.g. there is no added whitespace and floats are printed with fixed precision in exponential form. Only the plain JSON types are allowed. Objects must have unique string keys.

Function Documentation

char* jx_canonicalize ( struct jx j)

Canonicalize a JX expression to a string.

The caller must free() the returned string.

Parameters
jA JX expression.
Returns
NULL With an invalid JX structure.