sexpr.h File Reference

#include <stdio.h>
#include <isc/lang.h>
#include <isccc/types.h>

Go to the source code of this file.

Data Structures

struct  isccc_dottedpair
 dotted pair structure More...
struct  isccc_sexpr
 iscc_sexpr structure More...

Defines

#define ISCCC_SEXPR_H   1
#define ISCCC_SEXPRTYPE_NONE   0x00
 Illegal.
#define ISCCC_SEXPRTYPE_T   0x01
#define ISCCC_SEXPRTYPE_STRING   0x02
#define ISCCC_SEXPRTYPE_DOTTEDPAIR   0x03
#define ISCCC_SEXPRTYPE_BINARY   0x04
#define ISCCC_SEXPR_CAR(s)   (s)->value.as_dottedpair.car
#define ISCCC_SEXPR_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)
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)


Detailed Description

Definition in file sexpr.h.


Define Documentation

#define ISCCC_SEXPR_H   1

Definition at line 35 of file sexpr.h.

#define ISCCC_SEXPRTYPE_NONE   0x00

Illegal.

Definition at line 62 of file sexpr.h.

#define ISCCC_SEXPRTYPE_T   0x01

Definition at line 63 of file sexpr.h.

Referenced by isccc_sexpr_print().

#define ISCCC_SEXPRTYPE_STRING   0x02

Definition at line 64 of file sexpr.h.

Referenced by isccc_alist_alistp(), isccc_alist_assq(), isccc_alist_delete(), isccc_sexpr_free(), isccc_sexpr_fromstring(), isccc_sexpr_print(), isccc_sexpr_stringp(), and isccc_sexpr_tostring().

#define ISCCC_SEXPRTYPE_DOTTEDPAIR   0x03

Definition at line 65 of file sexpr.h.

Referenced by isccc_alist_alistp(), isccc_alist_assq(), isccc_alist_delete(), isccc_sexpr_addtolist(), isccc_sexpr_car(), isccc_sexpr_cdr(), isccc_sexpr_cons(), isccc_sexpr_free(), isccc_sexpr_listp(), isccc_sexpr_print(), isccc_sexpr_setcar(), and isccc_sexpr_setcdr().

#define ISCCC_SEXPRTYPE_BINARY   0x04

Definition at line 66 of file sexpr.h.

Referenced by isccc_sexpr_binaryp(), isccc_sexpr_free(), isccc_sexpr_frombinary(), isccc_sexpr_print(), isccc_sexpr_tobinary(), and isccc_sexpr_tostring().

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

Definition at line 68 of file sexpr.h.

Referenced by list_towire(), and table_towire().

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

Definition at line 69 of file sexpr.h.

Referenced by isccc_cc_lookupstring(), isccc_cc_lookupuint32(), list_towire(), and table_towire().


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().

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().


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