mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-22 00:40:30 +00:00
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@625 e7d03fd6-7b0d-0410-9947-9c21f3af8025
54 lines
1.5 KiB
C
54 lines
1.5 KiB
C
#ifndef HTMLSAX_H
|
|
#define HTMLSAX_H
|
|
|
|
#include "Python.h"
|
|
|
|
/* require Python >= 2.0 */
|
|
#ifndef PY_VERSION_HEX
|
|
#error please install Python >= 2.0
|
|
#endif
|
|
|
|
#if PY_VERSION_HEX < 0x02000000
|
|
#error please install Python >= 2.0
|
|
#endif
|
|
|
|
/* user_data type for SAX calls */
|
|
typedef struct {
|
|
/* the Python SAX class instance to issue callbacks */
|
|
PyObject* handler;
|
|
/* Buffer to store still-to-be-scanned characters. After recognizing
|
|
* a complete syntax element, all data up to bufpos will be removed.
|
|
* Before scanning you should append new data to this buffer.
|
|
*/
|
|
char* buf;
|
|
/* current position in the buffer counting from zero */
|
|
unsigned int bufpos;
|
|
/* current position of next syntax element */
|
|
unsigned int nextpos;
|
|
/* position in the stream of data already seen, counting from zero */
|
|
unsigned int pos;
|
|
/* line counter, counting from one */
|
|
unsigned int lineno;
|
|
/* last value of line counter */
|
|
unsigned int last_lineno;
|
|
/* column counter, counting from zero */
|
|
unsigned int column;
|
|
/* last value of column counter */
|
|
unsigned int last_column;
|
|
/* temporary vars */
|
|
void* lexbuf;
|
|
char* tmp_buf;
|
|
PyObject* tmp_tag;
|
|
PyObject* tmp_attrname;
|
|
PyObject* tmp_attrval;
|
|
PyObject* tmp_attrs;
|
|
/* stored Python exception (if error occurred in scanner) */
|
|
PyObject* exc_type;
|
|
PyObject* exc_val;
|
|
PyObject* exc_tb;
|
|
/* error string */
|
|
char* error;
|
|
} UserData;
|
|
extern char* stpcpy(char* src, const char* dest);
|
|
|
|
#endif
|