SgmlExtensionHtml.h Source File

Main Page Modules Namespace List Data Structures File List Data Fields Examples

# SgmlExtensionHtml.h

    00001 /*
    00002  * libsgml -- SGML state machine parsing library.
    00003  *
    00004  * Copyright (c) 2002 Uninformed Research (http://www.uninformed.org)
    00005  * All rights reserved.
    00006  *
    00007  * skape
    00008  * mmiller@hick.org
    00009  */
    00018 #ifndef _LIBSGML_SGMLEXTENSIONHTML_H
    00019 #define _LIBSGML_SGMLEXTENSIONHTML_H
    00020
    00021 #ifdef __cplusplus
    00022 extern "C" {
    00023 #endif
    00024
    00025 #include "DomDocument.h"
    00026 #include "DomElement.h"
    00027 #include "DomText.h"
    00028 #include "DomComment.h"
    00029
    00030 #include "DomNodeList.h"
    00031
    00053 #define SGML_EXTENSION_HTML_PARAM_FLAG            0x00000001
    00054
    00059 #define SGML_EXTENSION_HTML_PARAM_SETKNOWNTAGS    0x00000002
    00060
    00066 #define SGML_EXTENSION_HTML_FLAG_STRIPELEMENT      (1 << 0)
    00067
    00072 #define SGML_EXTENSION_HTML_FLAG_STRIPTEXT         (1 << 1)
    00073
    00078 #define SGML_EXTENSION_HTML_FLAG_STRIPCOMMENT      (1 << 2)
    00079
    00084 #define SGML_EXTENSION_HTML_FLAG_IGNOREBLANKLINES  (1 << 3)
    00085
    00090 #define SGML_EXTENSION_HTML_FLAG_ESCAPEUNKNOWNTAGS (1 << 4)
    00091
    00096 typedef struct _sgml_extension_html {
    00097
    00098         DOM_DOCUMENT  *document;
    00099         DOM_ELEMENT   *currElement;
    00100
    00101         unsigned char skipNextAttribute;
    00102
    00103         unsigned long flags;
    00104
    00105         char          **knownTags;
    00106
    00107         void (*saveDivert)(struct _sgml_parser *parser, unsigned long newIndex, unsigned long oldState, unsigned long newState, const char *lastBuffer, unsigned long lastBufferSize);
    00108
    00109 } SGML_EXTENSION_HTML;
    00110
    00111 SGML_EXTENSION_HTML *sgmlExtensionHtmlNew(SGML_PARSER *parser);
    00112 void sgmlExtensionHtmlDestroy(SGML_PARSER *parser, SGML_EXTENSION_HTML *ext);
    00113
    00114 void sgmlExtensionHtmlInitialize(SGML_PARSER *parser, void *userContext);
    00115 void sgmlExtensionHtmlElementBegin(SGML_PARSER *parser, void *userContext, const char *elementName);
    00116 void sgmlExtensionHtmlElementEnd(SGML_PARSER *parser, void *userContext, const char *elementName);
    00117 void sgmlExtensionHtmlAttributeNew(SGML_PARSER *parser, void *userContext, const char *attributeName, const char *attributeValue);
    00118 void sgmlExtensionHtmlTextNew(SGML_PARSER *parser, void *userContext, const char *text);
    00119 void sgmlExtensionHtmlCommentNew(SGML_PARSER *parser, void *userContext, const char *comment);
    00120 void sgmlExtensionHtmlDeinitialize(SGML_PARSER *parser, void *userContext);
    00121
    00146 void sgmlExtensionHtmlSetParam(SGML_PARSER *parser, void *extensionContext, unsigned long param, void *value);
    00155 void sgmlExtensionHtmlGetParam(SGML_PARSER *parser, void *extensionContext, unsigned long param, void *value);
    00156
    00162 DOM_DOCUMENT *sgmlExtensionHtmlGetDocument(SGML_PARSER *parser);
    00163
    00168 #ifdef __cplusplus
    00169 }
    00170 #endif
    00171
    00172 #endif