sexpr.c File Reference

#include <config.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <isc/assertions.h>
#include <isccc/sexpr.h>
#include <isccc/util.h>

Go to the source code of this file.

Defines

#define CAR(s)   (s)->value.as_dottedpair.car
#define CDR(s)   (s)->value.as_dottedpair.cdr

Functions

isccc_sexpr_tisccc_sexpr_cons (isccc_sexpr_t *car, isccc_sexpr_t *cdr)
isccc_sexpr_tisccc_sexpr_tconst (void)
isccc_sexpr_tisccc_sexpr_fromstring (const char *str)
isccc_sexpr_tisccc_sexpr_frombinary (const isccc_region_t *region)
void isccc_sexpr_free (isccc_sexpr_t **sexprp)
static isc_boolean_t printable (isccc_region_t *r)
void isccc_sexpr_print (isccc_sexpr_t *sexpr, FILE *stream)
isccc_sexpr_tisccc_sexpr_car (isccc_sexpr_t *list)
isccc_sexpr_tisccc_sexpr_cdr (isccc_sexpr_t *list)
void isccc_sexpr_setcar (isccc_sexpr_t *pair, isccc_sexpr_t *car)
void isccc_sexpr_setcdr (isccc_sexpr_t *pair, isccc_sexpr_t *cdr)
isccc_sexpr_tisccc_sexpr_addtolist (isccc_sexpr_t **l1p, isccc_sexpr_t *l2)
isc_boolean_t isccc_sexpr_listp (isccc_sexpr_t *sexpr)
isc_boolean_t isccc_sexpr_emptyp (isccc_sexpr_t *sexpr)
isc_boolean_t isccc_sexpr_stringp (isccc_sexpr_t *sexpr)
isc_boolean_t isccc_sexpr_binaryp (isccc_sexpr_t *sexpr)
char * isccc_sexpr_tostring (isccc_sexpr_t *sexpr)
isccc_region_tisccc_sexpr_tobinary (isccc_sexpr_t *sexpr)

Variables

static isccc_sexpr_t sexpr_t = { ISCCC_SEXPRTYPE_T, { NULL } }


Detailed Description

Definition in file sexpr.c.


Define Documentation

#define CAR ( s   )     (s)->value.as_dottedpair.car

Definition at line 48 of file sexpr.c.

#define CDR ( s   )     (s)->value.as_dottedpair.cdr

Definition at line 49 of file sexpr.c.


Function Documentation

isccc_sexpr_t* isccc_sexpr_cons ( isccc_sexpr_t car,
isccc_sexpr_t cdr 
)

Definition at line 52 of file sexpr.c.

References CAR, CDR, ISCCC_SEXPRTYPE_DOTTEDPAIR, and isccc_sexpr::type.

Referenced by isccc_alist_create(), isccc_alist_define(), and isccc_sexpr_addtolist().

isccc_sexpr_t* isccc_sexpr_tconst ( void   ) 

Definition at line 67 of file sexpr.c.

isccc_sexpr_t* isccc_sexpr_fromstring ( const char *  str  ) 

Definition at line 73 of file sexpr.c.

References isccc_sexpr::as_string, free(), ISCCC_SEXPRTYPE_STRING, strdup(), isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_create(), isccc_alist_define(), and isccc_alist_definestring().

isccc_sexpr_t* isccc_sexpr_frombinary ( const isccc_region_t region  ) 

Definition at line 91 of file sexpr.c.

References isccc_sexpr::as_region, free(), ISCCC_SEXPRTYPE_BINARY, REGION_SIZE, isccc_region::rend, isccc_region::rstart, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_definebinary(), and value_fromwire().

void isccc_sexpr_free ( isccc_sexpr_t **  sexprp  ) 

Definition at line 125 of file sexpr.c.

References isccc_sexpr::as_region, isccc_sexpr::as_string, CAR, CDR, free(), isccc_sexpr_free(), ISCCC_SEXPRTYPE_BINARY, ISCCC_SEXPRTYPE_DOTTEDPAIR, ISCCC_SEXPRTYPE_STRING, isccc_region::rstart, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by control_recvmessage(), createmessage(), isccc_alist_create(), isccc_alist_define(), isccc_alist_definebinary(), isccc_alist_definestring(), isccc_alist_delete(), isccc_cc_createack(), isccc_cc_createresponse(), isccc_sexpr_free(), list_fromwire(), rndc_recvdone(), rndc_recvnonce(), and table_fromwire().

static isc_boolean_t printable ( isccc_region_t r  )  [static]

Definition at line 155 of file sexpr.c.

References ISC_FALSE, ISC_TRUE, isccc_region::rend, and isccc_region::rstart.

Referenced by isccc_sexpr_print().

void isccc_sexpr_print ( isccc_sexpr_t sexpr,
FILE *  stream 
)

Definition at line 170 of file sexpr.c.

References isccc_sexpr::as_region, isccc_sexpr::as_string, CAR, CDR, INSIST, isccc_sexpr_print(), ISCCC_SEXPRTYPE_BINARY, ISCCC_SEXPRTYPE_DOTTEDPAIR, ISCCC_SEXPRTYPE_STRING, ISCCC_SEXPRTYPE_T, printable(), REGION_SIZE, isccc_region::rstart, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_prettyprint(), and isccc_sexpr_print().

isccc_sexpr_t* isccc_sexpr_car ( isccc_sexpr_t list  ) 

Definition at line 222 of file sexpr.c.

References CAR, ISCCC_SEXPRTYPE_DOTTEDPAIR, REQUIRE, and isccc_sexpr::type.

isccc_sexpr_t* isccc_sexpr_cdr ( isccc_sexpr_t list  ) 

Definition at line 230 of file sexpr.c.

References CDR, ISCCC_SEXPRTYPE_DOTTEDPAIR, REQUIRE, and isccc_sexpr::type.

void isccc_sexpr_setcar ( isccc_sexpr_t pair,
isccc_sexpr_t car 
)

Definition at line 238 of file sexpr.c.

References CAR, ISCCC_SEXPRTYPE_DOTTEDPAIR, REQUIRE, and isccc_sexpr::type.

void isccc_sexpr_setcdr ( isccc_sexpr_t pair,
isccc_sexpr_t cdr 
)

Definition at line 246 of file sexpr.c.

References CDR, ISCCC_SEXPRTYPE_DOTTEDPAIR, REQUIRE, and isccc_sexpr::type.

isccc_sexpr_t* isccc_sexpr_addtolist ( isccc_sexpr_t **  l1p,
isccc_sexpr_t l2 
)

Definition at line 254 of file sexpr.c.

References CDR, isccc_sexpr_cons(), ISCCC_SEXPRTYPE_DOTTEDPAIR, REQUIRE, and isccc_sexpr::type.

Referenced by isccc_alist_define(), and list_fromwire().

isc_boolean_t isccc_sexpr_listp ( isccc_sexpr_t sexpr  ) 

Definition at line 277 of file sexpr.c.

References ISC_FALSE, ISC_TRUE, ISCCC_SEXPRTYPE_DOTTEDPAIR, and isccc_sexpr::type.

Referenced by isccc_alist_prettyprint(), and value_towire().

isc_boolean_t isccc_sexpr_emptyp ( isccc_sexpr_t sexpr  ) 

Definition at line 285 of file sexpr.c.

References ISC_FALSE, and ISC_TRUE.

isc_boolean_t isccc_sexpr_stringp ( isccc_sexpr_t sexpr  ) 

Definition at line 293 of file sexpr.c.

References ISC_FALSE, ISC_TRUE, ISCCC_SEXPRTYPE_STRING, and isccc_sexpr::type.

Referenced by isccc_alist_lookupstring(), and isccc_alist_prettyprint().

isc_boolean_t isccc_sexpr_binaryp ( isccc_sexpr_t sexpr  ) 

Definition at line 301 of file sexpr.c.

References ISC_FALSE, ISC_TRUE, ISCCC_SEXPRTYPE_BINARY, and isccc_sexpr::type.

Referenced by isccc_alist_lookupbinary(), isccc_cc_lookupstring(), isccc_cc_lookupuint32(), and value_towire().

char* isccc_sexpr_tostring ( isccc_sexpr_t sexpr  ) 

Definition at line 309 of file sexpr.c.

References isccc_sexpr::as_region, isccc_sexpr::as_string, ISCCC_SEXPRTYPE_BINARY, ISCCC_SEXPRTYPE_STRING, REQUIRE, isccc_region::rstart, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_lookupstring(), isccc_alist_prettyprint(), isccc_cc_lookupstring(), isccc_cc_lookupuint32(), table_towire(), and verify().

isccc_region_t* isccc_sexpr_tobinary ( isccc_sexpr_t sexpr  ) 

Definition at line 321 of file sexpr.c.

References isccc_sexpr::as_region, ISCCC_SEXPRTYPE_BINARY, REQUIRE, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_lookupbinary(), and value_towire().


Variable Documentation

isccc_sexpr_t sexpr_t = { ISCCC_SEXPRTYPE_T, { NULL } } [static]

Definition at line 46 of file sexpr.c.


Generated on Tue Apr 28 17:41:19 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha