/*
* Summary: interface for an HTML 4.0 non-verifying parser
* Description: this module implements an HTML 4.0 non-verifying parser
* with API compatible with the XML parser ones. It should
* be able to parse "real world" HTML, even if severely
* broken from a specification point of view.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __HTML_PARSER_H__
#define __HTML_PARSER_H__
#include <libxml/xmlversion.h>
#ifdef LIBXML_HTML_ENABLED
#ifdef __cplusplus
extern "C" {
#endif
/*
* Most of the back-end structures from XML and HTML are shared.
*/
/*
* Internal description of an HTML element, representing HTML 4.01
* and XHTML 1.0 (which share the same structure).
*/
struct _htmlElemDesc {
/* NRK Jan.2003
* New fields encapsulating HTML structure
*
* Bugs:
* This is a very limited representation. It fails to tell us when
* an element *requires* subelements (we only have whether they're
* allowed or not), and it doesn't tell us where CDATA and PCDATA
* are allowed. Some element relationships are not fully represented:
* these are flagged with the word MODIFIER
*/
if necessary or NULL */
};
/*
* Internal description of an HTML entity.
*/
struct _htmlEntityDesc {
};
/*
* There is only few public functions.
*/
htmlEntityValueLookup(unsigned int value);
htmlNewParserCtxt(void);
htmlCreateMemoryParserCtxt(const char *buffer,
int size);
const char *encoding,
void *userData);
const char *encoding);
htmlSAXParseFile(const char *filename,
const char *encoding,
void *userData);
htmlParseFile (const char *filename,
const char *encoding);
UTF8ToHtml (unsigned char *out,
int *outlen,
const unsigned char *in,
int *inlen);
htmlEncodeEntities(unsigned char *out,
int *outlen,
const unsigned char *in,
htmlHandleOmittedElem(int val);
#ifdef LIBXML_PUSH_ENABLED
/**
* Interfaces for the Push mode.
*/
void *user_data,
const char *chunk,
int size,
const char *filename,
const char *chunk,
int size,
int terminate);
#endif /* LIBXML_PUSH_ENABLED */
/*
*/
/**
* xmlParserOption:
*
* This is the set of XML parser options that can be passed down
* to the xmlReadDoc() and similar calls.
*/
typedef enum {
int options);
const char *URL,
const char *encoding,
int options);
htmlReadFile (const char *URL,
const char *encoding,
int options);
htmlReadMemory (const char *buffer,
int size,
const char *URL,
const char *encoding,
int options);
htmlReadFd (int fd,
const char *URL,
const char *encoding,
int options);
void *ioctx,
const char *URL,
const char *encoding,
int options);
const char *URL,
const char *encoding,
int options);
const char *filename,
const char *encoding,
int options);
const char *buffer,
int size,
const char *URL,
const char *encoding,
int options);
int fd,
const char *URL,
const char *encoding,
int options);
void *ioctx,
const char *URL,
const char *encoding,
int options);
*/
typedef enum {
} htmlStatus ;
/* Using htmlElemDesc rather than name here, to emphasise the fact
that otherwise there's a lookup overhead
*/
/**
* htmlDefaultSubelement:
* @elt: HTML element
*
* Returns the default subelement for this element
*/
/**
* htmlElementAllowedHereDesc:
* @parent: HTML parent element
* @elt: HTML element
*
* Checks whether an HTML element description may be a
* direct child of the specified element.
*
* Returns 1 if allowed; 0 otherwise.
*/
/**
* htmlRequiredAttrs:
* @elt: HTML element
*
* Returns the attributes required for the specified element.
*/
#ifdef __cplusplus
}
#endif
#endif /* LIBXML_HTML_ENABLED */
#endif /* __HTML_PARSER_H__ */