/** * HTML file reading * * @file platon/html/read.h * @author Ondrej Jombik * @version \$Platon: libplaton/platon/html/read.h,v 1.10 2003/04/23 19:01:36 nepto Exp $ * @date 2000-2003 * * Function in this file can be used for fast and simple SGML/HTML files * reading. Usage with platon/html/Tag.h is recommended. */ #ifndef _PLATON_HTML_READ_H #define _PLATON_HTML_READ_H /** HTML tag starting character */ #ifndef HTML_TAG_BEGIN # define HTML_TAG_BEGIN '<' #endif /** HTML tag ending character */ #ifndef HTML_TAG_END # define HTML_TAG_END '>' #endif /** * Return codes for html_read() function * @see html_read() */ enum html_reads { HTML_ERROR, /**< Error occured */ HTML_EOF, /**< End of HTML file reached */ HTML_TAG, /**< Tag returned */ HTML_TEXT /**< Text returned */ }; #ifdef __cplusplus extern "C" { #endif /** * Read next tag or text from stream * * @param f stream * @param p string where to store read data * @param len maximum len of data * @return @ref html_reads enumeration * * Into p will be stored either text or tag with maximum length len. If * tag, than also with @ref HTML_TAG_BEGIN and @ref HTML_TAG_END * characters. */ enum html_reads html_read(FILE *f, char *p, int len); #ifdef __cplusplus } #endif #endif /* #ifndef _PLATON_HTML_READ_H */