libwww_parse.h

00001 /* File:      libwww_parse.h
00002 ** Author(s): kifer
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.h,v 1.3 2000/04/05 02:17:11 kifer Exp $
00022 ** 
00023 */
00024 
00025 /* included macros for XML and HTML parsing only */
00026 
00027 
00028 #define PARSE_STACK_INCREMENT  50
00029 
00030 
00031 #define STACK_TOP(htext)        htext->stack[htext->stackptr]
00032 #define STACK_PREV(htext)       htext->stack[htext->stackptr-1]
00033 
00034 #define suppressing(htext) \
00035                      ( (htext->stackptr < 0 && htext->suppress_is_default) \
00036                        ||(htext->stackptr >= 0 && STACK_TOP(htext).suppress))
00037 #define parsing(htext)  (!suppressing(htext))
00038 
00039 
00040 #define IS_SELECTED_TAG(element, request) \
00041     is_in_htable(element, \
00042                  &(((REQUEST_CONTEXT *)HTRequest_context(request))->selected_tags_tbl))
00043 #define IS_SUPPRESSED_TAG(element, request) \
00044     is_in_htable(element, \
00045                  &(((REQUEST_CONTEXT *)HTRequest_context(request))->suppressed_tags_tbl))
00046 #define IS_STRIPPED_TAG(element, request) \
00047     is_in_htable(element, \
00048                  &(((REQUEST_CONTEXT *)HTRequest_context(request))->stripped_tags_tbl))
00049 
00050 #define CHECK_STACK_OVERFLOW(userdata) \
00051     if (userdata->stackptr >= userdata->stacksize) { \
00052        userdata->stack =  \
00053          realloc(userdata->stack, \
00054                  (userdata->stacksize + PARSE_STACK_INCREMENT) \
00055                  * sizeof(struct stack_node)); \
00056        userdata->stacksize += PARSE_STACK_INCREMENT; \
00057     }
00058 
00059 #define SETUP_STACK(userdata) \
00060     userdata->stackptr = -1; \
00061     userdata->stack = \
00062          malloc(PARSE_STACK_INCREMENT * sizeof(struct stack_node)); \
00063     userdata->stacksize = PARSE_STACK_INCREMENT;

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