libwww_parse_xml.h

00001 /* File:      libwww_parse_xml.h
00002 ** Author(s): kifer, Yang Yang
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 2000
00006 ** 
00007 ** XSB is free software; you can redistribute it and/or modify it under the
00008 ** terms of the GNU Library General Public License as published by the Free
00009 ** Software Foundation; either version 2 of the License, or (at your option)
00010 ** any later version.
00011 ** 
00012 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00013 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00015 ** more details.
00016 ** 
00017 ** You should have received a copy of the GNU Library General Public License
00018 ** along with XSB; if not, write to the Free Software Foundation,
00019 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 **
00021 ** $Id: libwww_parse_xml.h,v 1.7 2000/04/11 22:06:42 kifer Exp $
00022 ** 
00023 */
00024 
00025 
00026 typedef struct XML_userData USERDATA;
00027 struct XML_userData {
00028   DELETE_USERDATA *       delete_method;
00029   int                     status;          /* this is used to carry status into
00030                                               delete_userData */
00031   XML_Parser              parser; 
00032   HTRequest *             request;
00033   HTStream *              target;
00034   SGML_dtd *              dtd;
00035   int                     suppress_is_default; /* whether we begin parsing by
00036                                                   suppressing tags */
00037   prolog_term             parsed_term;      /* actual result of the parse */
00038   prolog_term             parsed_term_tail; /* auxil variable */
00039   int                     stackptr;
00040   int                     stacksize;  /* current size of stack */
00041   struct stack_node {
00042     XML_Char       *tag;              /* which element this is  */
00043     int            suppress;          /* whether this element is in the
00044                                          suppressed region */
00045     prolog_term    elt_term;          /* here we build elements */
00046     prolog_term    content_list_tail; /* auxil var to help build elements */
00047   }                       *stack;     /* keeps nested elements */
00048 };
00049 
00050 
00051 /* function declarations */
00052 
00053 PRIVATE USERDATA *xml_create_userData(XML_Parser parser,
00054                                       HTRequest  *request,
00055                                       HTStream   *target_stream);
00056 PRIVATE void xml_delete_userData(void *me);
00057 
00058 PRIVATE int xml_push_element (USERDATA    *userdata,
00059                               const XML_Char  *tag,
00060                               const XML_Char  **attrs);
00061 PRIVATE void xml_pop_element(USERDATA *userdata);
00062 PRIVATE void xml_push_suppressed_element(USERDATA   *userdata,
00063                                          const XML_Char *tag);
00064 PRIVATE void xml_pop_suppressed_element(USERDATA *userdata);
00065 PRIVATE void collect_xml_attributes (prolog_term     elt_term,
00066                                      const XML_Char  **attrs);
00067 
00068 
00069 PRIVATE void xml_addText (void           *userdata,
00070                           const XML_Char *textbuf,
00071                           int            len);
00072 PRIVATE void xml_beginElement(void           *userdata,
00073                               const XML_Char *tag,
00074                               const XML_Char **attributes);
00075 PRIVATE void xml_endElement(void *userdata, const XML_Char *tag);
00076 
00077 
00078 PRIVATE void xml_processingInstruction (void           *userData,
00079                                         const XML_Char *target,
00080                                         const XML_Char *data);
00081 PRIVATE void xml_unparsedEntityDecl (void           *userData,
00082                                      const XML_Char *entityName,
00083                                      const XML_Char *base,
00084                                      const XML_Char *systemId,
00085                                      const XML_Char *publicId,
00086                                      const XML_Char *notationName);
00087 PRIVATE void xml_notationDecl (void           *userData,
00088                                const XML_Char *notationName,
00089                                const XML_Char *base,
00090                                const XML_Char *systemId,
00091                                const XML_Char *publicId);
00092 PRIVATE int xml_externalEntityRef (XML_Parser     parser,
00093                                    const XML_Char *openEntityNames,
00094                                    const XML_Char *base,
00095                                    const XML_Char *systemId,
00096                                    const XML_Char *publicId);
00097 PRIVATE int xml_unknownEncoding (void           *encodingHandlerData,
00098                                  const XML_Char *name,
00099                                  XML_Encoding   *info);
00100 /*
00101   PRIVATE void xml_default (void * userData, const XML_Char * s, int len);
00102 */
00103 
00104 PRIVATE prolog_term xml_push_dummy(USERDATA    *userdata);

Generated on Wed Jul 26 13:30:45 2006 for XSB by  doxygen 1.4.5