alist.c File Reference

#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <isccc/alist.h>
#include <isc/assertions.h>
#include <isccc/result.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
#define ALIST_TAG   "*alist*"
#define MAX_INDENT   64

Functions

isccc_sexpr_tisccc_alist_create (void)
isc_boolean_t isccc_alist_alistp (isccc_sexpr_t *alist)
isc_boolean_t isccc_alist_emptyp (isccc_sexpr_t *alist)
isccc_sexpr_tisccc_alist_first (isccc_sexpr_t *alist)
isccc_sexpr_tisccc_alist_assq (isccc_sexpr_t *alist, const char *key)
void isccc_alist_delete (isccc_sexpr_t *alist, const char *key)
isccc_sexpr_tisccc_alist_define (isccc_sexpr_t *alist, const char *key, isccc_sexpr_t *value)
isccc_sexpr_tisccc_alist_definestring (isccc_sexpr_t *alist, const char *key, const char *str)
isccc_sexpr_tisccc_alist_definebinary (isccc_sexpr_t *alist, const char *key, isccc_region_t *r)
isccc_sexpr_tisccc_alist_lookup (isccc_sexpr_t *alist, const char *key)
isc_result_t isccc_alist_lookupstring (isccc_sexpr_t *alist, const char *key, char **strp)
isc_result_t isccc_alist_lookupbinary (isccc_sexpr_t *alist, const char *key, isccc_region_t **r)
void isccc_alist_prettyprint (isccc_sexpr_t *sexpr, unsigned int indent, FILE *stream)

Variables

static char spaces [MAX_INDENT+1]


Detailed Description

Definition in file alist.c.


Define Documentation

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

Definition at line 47 of file alist.c.

Referenced by isccc_alist_alistp(), isccc_alist_assq(), isccc_alist_delete(), isccc_alist_prettyprint(), isccc_sexpr_car(), isccc_sexpr_cons(), isccc_sexpr_free(), isccc_sexpr_print(), and isccc_sexpr_setcar().

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

Definition at line 48 of file alist.c.

Referenced by isccc_alist_assq(), isccc_alist_define(), isccc_alist_delete(), isccc_alist_emptyp(), isccc_alist_first(), isccc_alist_lookup(), isccc_alist_lookupbinary(), isccc_alist_lookupstring(), isccc_alist_prettyprint(), isccc_sexpr_addtolist(), isccc_sexpr_cdr(), isccc_sexpr_cons(), isccc_sexpr_free(), isccc_sexpr_print(), and isccc_sexpr_setcdr().

#define ALIST_TAG   "*alist*"

Definition at line 50 of file alist.c.

Referenced by isccc_alist_alistp(), and isccc_alist_create().

#define MAX_INDENT   64

Definition at line 51 of file alist.c.


Function Documentation

isccc_sexpr_t* isccc_alist_create ( void   ) 

Definition at line 57 of file alist.c.

References ALIST_TAG, isccc_sexpr_cons(), isccc_sexpr_free(), and isccc_sexpr_fromstring().

Referenced by createmessage(), and table_fromwire().

isc_boolean_t isccc_alist_alistp ( isccc_sexpr_t alist  ) 

Definition at line 74 of file alist.c.

References ALIST_TAG, isccc_sexpr::as_string, CAR, ISC_FALSE, ISC_TRUE, ISCCC_SEXPRTYPE_DOTTEDPAIR, ISCCC_SEXPRTYPE_STRING, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_assq(), isccc_alist_delete(), isccc_alist_emptyp(), isccc_alist_first(), isccc_alist_prettyprint(), and value_towire().

isc_boolean_t isccc_alist_emptyp ( isccc_sexpr_t alist  ) 

Definition at line 89 of file alist.c.

References CDR, ISC_FALSE, ISC_TRUE, isccc_alist_alistp(), and REQUIRE.

isccc_sexpr_t* isccc_alist_first ( isccc_sexpr_t alist  ) 

Definition at line 99 of file alist.c.

References CDR, isccc_alist_alistp(), and REQUIRE.

Referenced by isccc_alist_prettyprint(), and table_towire().

isccc_sexpr_t* isccc_alist_assq ( isccc_sexpr_t alist,
const char *  key 
)

Definition at line 107 of file alist.c.

References isccc_sexpr::as_string, CAR, CDR, INSIST, isccc_alist_alistp(), ISCCC_SEXPRTYPE_DOTTEDPAIR, ISCCC_SEXPRTYPE_STRING, REQUIRE, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_alist_define(), isccc_alist_lookup(), isccc_alist_lookupbinary(), isccc_alist_lookupstring(), isccc_cc_lookupstring(), and isccc_cc_lookupuint32().

void isccc_alist_delete ( isccc_sexpr_t alist,
const char *  key 
)

Definition at line 133 of file alist.c.

References isccc_sexpr::as_string, CAR, CDR, INSIST, isccc_alist_alistp(), isccc_sexpr_free(), ISCCC_SEXPRTYPE_DOTTEDPAIR, ISCCC_SEXPRTYPE_STRING, REQUIRE, isccc_sexpr::type, and isccc_sexpr::value.

Referenced by isccc_cc_towire().

isccc_sexpr_t* isccc_alist_define ( isccc_sexpr_t alist,
const char *  key,
isccc_sexpr_t value 
)

Definition at line 159 of file alist.c.

References CDR, isccc_alist_assq(), isccc_sexpr_addtolist(), isccc_sexpr_cons(), isccc_sexpr_free(), and isccc_sexpr_fromstring().

Referenced by createmessage(), isccc_alist_definebinary(), isccc_alist_definestring(), and table_fromwire().

isccc_sexpr_t* isccc_alist_definestring ( isccc_sexpr_t alist,
const char *  key,
const char *  str 
)

Definition at line 193 of file alist.c.

References isccc_alist_define(), isccc_sexpr_free(), and isccc_sexpr_fromstring().

isccc_sexpr_t* isccc_alist_definebinary ( isccc_sexpr_t alist,
const char *  key,
isccc_region_t r 
)

Definition at line 208 of file alist.c.

References isccc_alist_define(), isccc_sexpr_free(), and isccc_sexpr_frombinary().

Referenced by isccc_cc_definestring(), and isccc_cc_defineuint32().

isccc_sexpr_t* isccc_alist_lookup ( isccc_sexpr_t alist,
const char *  key 
)

Definition at line 223 of file alist.c.

References CDR, and isccc_alist_assq().

Referenced by control_recvmessage(), isccc_cc_checkdup(), isccc_cc_createack(), isccc_cc_createresponse(), isccc_cc_isack(), isccc_cc_isreply(), ns_control_docommand(), rndc_connected(), rndc_recvdone(), rndc_recvnonce(), and verify().

isc_result_t isccc_alist_lookupstring ( isccc_sexpr_t alist,
const char *  key,
char **  strp 
)

Definition at line 234 of file alist.c.

References CDR, ISC_R_EXISTS, ISC_R_NOTFOUND, ISC_R_SUCCESS, isccc_alist_assq(), isccc_sexpr_stringp(), and isccc_sexpr_tostring().

isc_result_t isccc_alist_lookupbinary ( isccc_sexpr_t alist,
const char *  key,
isccc_region_t **  r 
)

Definition at line 253 of file alist.c.

References CDR, ISC_R_EXISTS, ISC_R_NOTFOUND, ISC_R_SUCCESS, isccc_alist_assq(), isccc_sexpr_binaryp(), and isccc_sexpr_tobinary().

void isccc_alist_prettyprint ( isccc_sexpr_t sexpr,
unsigned int  indent,
FILE *  stream 
)

Definition at line 272 of file alist.c.

References CAR, CDR, INSIST, isccc_alist_alistp(), isccc_alist_first(), isccc_alist_prettyprint(), isccc_sexpr_listp(), isccc_sexpr_print(), isccc_sexpr_stringp(), isccc_sexpr_tostring(), and spaces.

Referenced by isccc_alist_prettyprint().


Variable Documentation

char spaces[MAX_INDENT+1] [static]

Initial value:

 
        "                                                                "

Definition at line 53 of file alist.c.


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