/* Copyright (c) 2003, WebThing Ltd Author: Nick Kew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef MOD_XMLNS_H #define MOD_XMLNS_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct { struct ap_filter_t* f ; struct apr_bucket_brigade* bb ; XML_Parser parser ; struct xmlns_svr* svr ; struct apr_hash_t* activens ; /* hash of xmlns_active index by prefix */ } saxctxt ; typedef struct { const XML_Char* ns ; size_t nslen ; const XML_Char* elt ; size_t eltlen ; const XML_Char* prefix ; size_t prefixlen ; } parsedname ; typedef struct xmlns { const char* xmlns ; int (*StartElement) ( saxctxt*, const parsedname*, const XML_Char**) ; int (*EndElement) ( saxctxt*, const parsedname*) ; void (*StartNamespace) ( saxctxt*, void* ) ; void (*EndNamespace) ( saxctxt*, void* ) ; struct xmlns* next ; } xmlns ; /* The lifetime of an xmlns_active is from a StartNamespace to its EndNamespace event. They are indexed by prefix in the activens field of saxctxt. The userdata field is not used by the parser and is available to namespace implementations. */ typedef struct xmlns_active { void* userdata ; xmlns* ns ; int printed ; struct xmlns_active* prev ; } xmlns_active ; /* symbols to export for namespace implementations */ extern const char* NULLPREFIX ; extern XML_Parser attachCallbacks(XML_Parser) ; extern int parsename(const XML_Char*, parsedname*) ; extern char* ctype2encoding(apr_pool_t*, const char*) ; extern void (xdefault)(void*, const XML_Char*, int) ; extern void (xstartElement)(void*, const XML_Char*, const XML_Char**) ; extern void (xendElement)(void*, const XML_Char*) ; /* convenience defines */ #define CTX ((saxctxt*)ctx) #define F ((saxctxt*)ctx)->f->next #define BB ((saxctxt*)ctx)->bb #ifdef __cplusplus } #endif #endif