3
** ASSOCIATION LIST FOR STORING NAME-VALUE PAIRS.
4
** NAMES NOT CASE SENSITIVE, AND ONLY COMMON LENGTH
5
** IS CHECKED (allows abbreviations; well, length is
6
** taken from lookup-up name, so if table contains
7
** a shorter abbrev it is not found).
9
** AL Ari Luotonen luotonen@dxcern.cern.ch
25
PUBLIC HTAssocList *HTAssocList_new NOARGS
31
PUBLIC void HTAssocList_delete ARGS1(HTAssocList *, alist)
34
HTAssocList *cur = alist;
36
while (NULL != (assoc = (HTAssoc*)HTList_nextObject(cur))) {
47
PUBLIC void HTAssocList_add ARGS3(HTAssocList *, alist,
54
if (!(assoc = (HTAssoc*)malloc(sizeof(HTAssoc))))
55
outofmem(__FILE__, "HTAssoc_add");
60
StrAllocCopy(assoc->name, name);
62
StrAllocCopy(assoc->value, value);
63
HTList_addObject(alist, (void*)assoc);
65
CTRACE((tfp, "HTAssoc_add: ERROR: assoc list NULL!!\n"));
70
PUBLIC char *HTAssocList_lookup ARGS2(HTAssocList *, alist,
73
HTAssocList *cur = alist;
76
while (NULL != (assoc = (HTAssoc*)HTList_nextObject(cur))) {
77
if (!strncasecomp(assoc->name, name, strlen(name)))