dscrape

Duckduckgo CLI search/scraper
git clone git://git.codemadness.org/dscrape
Log | Files | Refs | README

xml.h (1545B)


      1 typedef struct xmlparser {
      2 	/* handlers */
      3 	void (*xmlattr)(struct xmlparser *, const char *, size_t,
      4 	      const char *, size_t, const char *, size_t);
      5 	void (*xmlattrend)(struct xmlparser *, const char *, size_t,
      6 	      const char *, size_t);
      7 	void (*xmlattrstart)(struct xmlparser *, const char *, size_t,
      8 	      const char *, size_t);
      9 	void (*xmlattrentity)(struct xmlparser *, const char *, size_t,
     10 	      const char *, size_t, const char *, size_t);
     11 	void (*xmlcdatastart)(struct xmlparser *);
     12 	void (*xmlcdata)(struct xmlparser *, const char *, size_t);
     13 	void (*xmlcdataend)(struct xmlparser *);
     14 	void (*xmlcommentstart)(struct xmlparser *);
     15 	void (*xmlcomment)(struct xmlparser *, const char *, size_t);
     16 	void (*xmlcommentend)(struct xmlparser *);
     17 	void (*xmldata)(struct xmlparser *, const char *, size_t);
     18 	void (*xmldataend)(struct xmlparser *);
     19 	void (*xmldataentity)(struct xmlparser *, const char *, size_t);
     20 	void (*xmldatastart)(struct xmlparser *);
     21 	void (*xmltagend)(struct xmlparser *, const char *, size_t, int);
     22 	void (*xmltagstart)(struct xmlparser *, const char *, size_t);
     23 	void (*xmltagstartparsed)(struct xmlparser *, const char *,
     24 	      size_t, int);
     25 
     26 	int (*getnext)(void);
     27 
     28 	/* current tag */
     29 	char tag[1024];
     30 	size_t taglen;
     31 	/* current tag is in short form ? <tag /> */
     32 	int isshorttag;
     33 	/* current attribute name */
     34 	char name[1024];
     35 	/* data buffer used for tag data, cdata and attribute data */
     36 	char data[BUFSIZ];
     37 } XMLParser;
     38 
     39 int xml_entitytostr(const char *, char *, size_t);
     40 void xml_parse(XMLParser *);