📄 htassoc.h
字号:
/* W3C Sample Code Library libwww Association Pairs! Association List For Storing Name-Value Pairs!*//*** (c) COPYRIGHT MIT 1995.** Please first read the full copyright statement in the file COPYRIGH.*//*This Assoctiation List class is closely related to theHTList Class as it simply is a list of a specificlist element containing a characters based name/value pair. Lookups fromassociation list are not case-sensitive.This module is implemented by HTAssoc.c, and it isa part of the W3C Sample CodeLibrary.*/#ifndef HTASSOC_H#define HTASSOC_H#include "HTList.h"typedef HTList HTAssocList;typedef struct { char * name; char * value;} HTAssoc;/*( Creation and Deletetion Methods)These methods create and deletes and association list*/extern HTAssocList * HTAssocList_new (void);extern BOOL HTAssocList_delete (HTAssocList * alist);/*( Add an Element to a List)We have two methods for adding new elements - you can either add unconditionallyor replace any existing element with the same name but a new value.A new list element is added to the beginning of the list so that it is thefirst element just after the head element.*/extern BOOL HTAssocList_addObject (HTAssocList * alist, const char * name, const char * value);extern BOOL HTAssocList_replaceObject (HTAssocList * list, const char * name, const char * value);/*( Remove an Element from a List)Remove the element with the given name from the list.*/extern BOOL HTAssocList_removeObject (HTAssocList * list, const char * name);/*( Search for Elements in a list)We have a small set of methods for searching a specific element within alist.*/extern char * HTAssocList_findObject (HTAssocList * alist, const char * name);/*( Get Name and Values)Use this to get the name and value of a assoc object*/#define HTAssoc_name(me) ((me) ? (me)->name : NULL)#define HTAssoc_value(me) ((me) ? (me)->value : NULL)/*( Traverse list)Fast macro to traverse the list. Call it first with copy of list header:it returns the first object and increments the passed list pointer. Callit with the same variable until it returns NULL.*/#define HTAssocList_nextObject(me) \ ((me) && ((me) = (me)->next) ? (me)->object : NULL)/**/#endif /* not HTASSOC_H *//* @(#) $Id: HTAssoc.html,v 2.17 1998/05/14 02:10:15 frystyk Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -