alist.c revision cb3e854e181373807f7f011e5050c1a8013b4841
/*
* Portions Copyright (C) 2001 Internet Software Consortium.
* Portions Copyright (C) 2001 Nominum, Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM AND
* NOMINUM DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
* SHALL INTERNET SOFTWARE CONSORTIUM OR NOMINUM BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: alist.c,v 1.2 2001/03/27 20:07:54 bwelling Exp $ */
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <isc/assertions.h>
#define ALIST_TAG "*alist*"
#define MAX_INDENT 64
" ";
isccc_alist_create(void)
{
return (NULL);
return (NULL);
}
return (alist);
}
{
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_TRUE);
}
{
return (ISC_TRUE);
return (ISC_FALSE);
}
{
}
{
/*
* Skip alist type tag.
*/
return (car);
}
return (NULL);
}
void
{
break;
}
}
}
{
/*
* New association.
*/
k = isccc_sexpr_fromstring(key);
if (k == NULL)
return (NULL);
return (NULL);
}
return (NULL);
}
} else {
/*
* We've already got an entry for this key. Replace it.
*/
}
return (kv);
}
{
isccc_sexpr_t *v, *kv;
v = isccc_sexpr_fromstring(str);
if (v == NULL)
return (NULL);
isccc_sexpr_free(&v);
return (kv);
}
{
isccc_sexpr_t *v, *kv;
v = isccc_sexpr_frombinary(r);
if (v == NULL)
return (NULL);
isccc_sexpr_free(&v);
return (kv);
}
{
return (NULL);
}
{
isccc_sexpr_t *kv, *v;
if (isccc_sexpr_stringp(v)) {
*strp = isccc_sexpr_tostring(v);
return (ISC_R_SUCCESS);
} else
return (ISC_R_EXISTS);
}
return (ISC_R_NOTFOUND);
}
{
isccc_sexpr_t *kv, *v;
if (isccc_sexpr_binaryp(v)) {
if (r != NULL)
*r = isccc_sexpr_tobinary(v);
return (ISC_R_SUCCESS);
} else
return (ISC_R_EXISTS);
}
return (ISC_R_NOTFOUND);
}
void
{
if (isccc_alist_alistp(sexpr)) {
indent += 4;
isccc_sexpr_tostring(k));
}
indent -= 4;
} else if (isccc_sexpr_listp(sexpr)) {
indent += 4;
}
indent -= 4;
} else
}