--- libaitwww/inc/aitwww.h 2012/03/08 23:40:21 1.1 +++ libaitwww/inc/aitwww.h 2012/03/10 00:26:49 1.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitwww.h,v 1.1 2012/03/08 23:40:21 misho Exp $ +* $Id: aitwww.h,v 1.2 2012/03/10 00:26:49 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -47,6 +47,11 @@ SUCH DAMAGE. #define __AITWWW_H +#include +#include +#include + + struct tagCGI { char *cgi_name; char *cgi_value; @@ -70,7 +75,15 @@ struct tagMIME { SLIST_ENTRY(tagMIME) mime_node; }; +typedef int (*list_cb_t)(struct tagCGI *, void *); + +// www_GetErrno() Get error code of last operation +inline int www_GetErrno(); +// www_GetError() Get error text of last operation +inline const char *www_GetError(); + + /* * www_initCGI() - Init CGI program * @@ -125,6 +138,15 @@ int www_addValue(cgi_t * __restrict cgi, const char *n * return: -1 error, 0 not found or 1 deleted ok */ int www_delPair(cgi_t * __restrict cgi, const char *name); +/* + * www_listPairs() - Walk over CGI session variables + * + * @cgi = Cgi session + * @func = If !=NULL call function for each element + * @arg = Optional argument pass through callback + * return: -1 error or >-1 number of elements + */ +inline int www_listPairs(cgi_t * __restrict cgi, list_cb_t func, void *arg); /* * www_header() - Output initial html header