cctools
jx_print.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2022 The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef JX_PRINT_H
8 #define JX_PRINT_H
9 
12 #include "jx.h"
13 #include "buffer.h"
14 #include "link.h"
15 #include <stdio.h>
16 
19 char * jx_print_string( struct jx *j );
20 
23 void jx_print_stream( struct jx *j, FILE *file );
24 
27 void jx_print_shell( struct jx *j, FILE *file );
28 
31 void jx_print_buffer( struct jx *j, buffer_t *buffer);
32 
35 void jx_print_link( struct jx *j, struct link *l, time_t stoptime );
36 
38 void jx_escape_string( const char *s, buffer_t *b );
39 
41 void jx_print_args( struct jx *j, buffer_t *b );
42 
44 const char * jx_operator_string( jx_operator_t type );
45 
47 const char * jx_type_string( jx_type_t type );
48 
49 // internal function for printing list comprehension expressions
50 void jx_comprehension_print(struct jx_comprehension *comp, buffer_t *b);
51 
52 
53 #endif
jx.h
jx_type_string
const char * jx_type_string(jx_type_t type)
Get a string representation of an object type.
jx_escape_string
void jx_escape_string(const char *s, buffer_t *b)
Print a C string in JSON format (with escape codes) into a buffer.
jx_operator_string
const char * jx_operator_string(jx_operator_t type)
Get a string representation of an operator.
jx_comprehension
Definition: jx.h:59
buffer
Definition: buffer.h:26
jx_print_buffer
void jx_print_buffer(struct jx *j, buffer_t *buffer)
Print a JX expression to a buffer.
jx_print_shell
void jx_print_shell(struct jx *j, FILE *file)
Print a JX object as shell environment variables.
jx::type
jx_type_t type
type of this value
Definition: jx.h:118
buffer.h
jx_print_stream
void jx_print_stream(struct jx *j, FILE *file)
Print a JX expression to a standard I/O stream.
jx_print_link
void jx_print_link(struct jx *j, struct link *l, time_t stoptime)
Print a JX expression to a link.
jx_type_t
jx_type_t
JX atomic type.
Definition: jx.h:43
jx_print_args
void jx_print_args(struct jx *j, buffer_t *b)
Print a list of arguments to a buffer.
jx_print_string
char * jx_print_string(struct jx *j)
Convert a JX expression into a string.
jx
JX value representing any expression type.
Definition: jx.h:117