--- libaitwww/inc/aitwww.h 2012/07/31 11:56:16 1.3.4.1 +++ libaitwww/inc/aitwww.h 2012/07/31 22:59:33 1.3.4.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitwww.h,v 1.3.4.1 2012/07/31 11:56:16 misho Exp $ +* $Id: aitwww.h,v 1.3.4.2 2012/07/31 22:59:33 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -50,6 +50,7 @@ SUCH DAMAGE. #include #include #include +#include /* URL staff ... */ @@ -89,8 +90,8 @@ struct tagReqXML { /* CGI variables */ struct tagCGI { - char *cgi_name; - char *cgi_value; + ait_val_t *cgi_name; + ait_val_t *cgi_value; SLIST_ENTRY(tagCGI) cgi_node; }; @@ -133,6 +134,7 @@ cgi_t *www_initCGI(void); * return: none */ void www_closeCGI(cgi_t ** __restrict cgi); +#define www_freeAttributes www_closeCGI /* * www_parseQuery() - Parse CGI query string * @@ -200,20 +202,13 @@ inline int www_header(FILE *output); */ inline cgi_t *www_parseAttributes(const char **ct); /* - * www_freeAttributes() - Free attributes + * www_getAttribute() - Get Attribute from attribute session * - * @attr = Attributes - * return: none + * @cgi = Inited attribute session + * @name = Name of attribute variable + * return: NULL not found or !=NULL value */ -inline void www_freeAttributes(cgi_t ** __restrict attr); -/* - * www_getAttribute() - Get attribute by name - * - * @attr = Attributes - * @name = Name of attribute - * return: NULL not found or !=NULL attribute value - */ -inline const char *www_getAttribute(cgi_t * __restrict attr, const char *name); +inline ait_val_t *www_getAttribute(cgi_t * __restrict cgi, const char *name); /* @@ -237,9 +232,9 @@ int www_cmptype(const char *ct, const char *type); * * @str = query string * @delim = delimiter - * return: NULL error or AV pair, must be free() after use! + * return: NULL error or AV pair, must be io_free() after use! */ -char *www_getpair(char ** __restrict str, const char *delim); +ait_val_t *www_getpair(char ** __restrict str, const char *delim); /* * www_x2c() - Hex from string to digit *