| version 1.3, 2002/02/04 18:38:10 |
version 1.4, 2002/09/19 15:01:11 |
|
|
| |
/** |
| |
* @file html/read.h |
| |
* @brief HTML file reading |
| |
* @author Ondrej Jombik <nepto@pobox.sk> |
| |
* @version \$Id$ |
| |
* @date 2001-2002 |
| |
*/ |
| |
|
| #ifndef _PLATON_HTML_READ_H |
#ifndef _PLATON_HTML_READ_H |
| #define _PLATON_HTML_READ_H |
#define _PLATON_HTML_READ_H |
| |
|
| |
/** HTML tag starting character */ |
| #ifndef HTML_TAG_BEGIN |
#ifndef HTML_TAG_BEGIN |
| #define HTML_TAG_BEGIN '<' |
# define HTML_TAG_BEGIN '<' |
| #endif |
#endif |
| |
|
| |
/** HTML tag ending character */ |
| #ifndef HTML_TAG_END |
#ifndef HTML_TAG_END |
| #define HTML_TAG_END '>' |
# define HTML_TAG_END '>' |
| #endif |
#endif |
| |
|
| typedef enum html_reads { |
/** |
| HTML_ERROR, |
* Return codes for html_read() function |
| HTML_EOF, |
* @see html_read() |
| HTML_TAG, |
*/ |
| HTML_TEXT |
typedef enum html_reads |
| |
{ |
| |
HTML_ERROR, /**< Error occured */ |
| |
HTML_EOF, /**< End of HTML file reached */ |
| |
HTML_TAG, /**< Tag returned */ |
| |
HTML_TEXT /**< Text returned */ |
| }; |
}; |
| |
|
| #ifdef __cplusplus |
#ifdef __cplusplus |
| extern "C" { |
extern "C" { |
| #endif |
#endif |
| |
|
| /* |
/** |
| * html_read() |
* Read next tag or text from stream |
| |
* |
| |
* @param f stream pointer (FILE *) |
| |
* @param p string where to store read data |
| |
* @param len maximum len of data |
| * |
* |
| * Into p will be stored either text or tag. |
* Into p will be stored either text or tag with maximum length len. |
| * If tag, than also with < > characters. |
* If tag, than also with HTML_TAG_BEGIN and HTML_TAG_END characters. |
| */ |
*/ |
| enum html_reads html_read(FILE *f, char *p, int len); |
enum html_reads html_read(FILE *f, char *p, int len); |
| |
|