libwww_parse_html.h

00001 /* File:      libwww_parse_html.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_html.h,v 1.6 2000/04/05 02:17:11 kifer Exp $
00022 ** 
00023 */
00024 
00025 
00026 typedef HText  USERDATA;
00027 struct _HText {
00028   DELETE_USERDATA *       delete_method;
00029   int                     status;          /* this is used to carry status into
00030                                               delete_userData */
00031   HTRequest *             request;
00032   HTParentAnchor *        node_anchor;     /* not used */
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     int            element_number;    /* which element this is  */
00043     SGMLContent    element_type;      /* SGML_EMPTY, PCDATA_SPECIAL, normal */
00044     int            suppress;          /* whether this element is in the
00045                                          suppressed region */
00046     prolog_term    elt_term;          /* here we build elements */
00047     prolog_term    content_list_tail; /* auxil var to help build elements */
00048   }                       *stack;     /* keeps nested elements */
00049 };
00050 
00051 
00052 /* function declarations */
00053 
00054 PRIVATE inline HTTag *special_find_tag(USERDATA *htext, int element_number);
00055 
00056 PRIVATE USERDATA *html_create_userData( HTRequest         *request,
00057                                         HTParentAnchor    *anchor,
00058                                         HTStream          *output_stream);
00059 PRIVATE void html_delete_userData(void *me);
00060 
00061 PRIVATE int find_matching_elt(USERDATA *htext, int elt_number);
00062 
00063 PRIVATE void html_push_element (USERDATA        *htext,
00064                                 int             element_number,
00065                                 const BOOL      *present,
00066                                 const char     **value);
00067 PRIVATE void html_pop_element(USERDATA *htext);
00068 PRIVATE void html_push_suppressed_element(USERDATA *htext, int element_number);
00069 PRIVATE void html_pop_suppressed_element(USERDATA *htext);
00070 PRIVATE void collect_html_attributes ( prolog_term  elt_term,
00071                                   HTTag        *tag,
00072                                   const BOOL   *present,
00073                                   const char  **value);
00074 
00075 
00076 PRIVATE void html_addText (USERDATA *htext, const char *textbuf, int len);
00077 PRIVATE void html_beginElement(USERDATA         *htext,
00078                                int              element_number,
00079                                const BOOL       *present,
00080                                const char       **value);
00081 PRIVATE void html_endElement(USERDATA *htext, int element_number);
00082 

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