Guest User

Untitled

a guest
Jul 31st, 2011
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.04 KB | None | 0 0
  1. //XML PARSER BY BLIPI
  2. //Feel free to distribute and use it on any plattform and projects
  3.  
  4. #ifndef XMLPARSER_H
  5. #define XMLPARSER_H
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <malloc.h>
  10. #include <string.h>
  11.  
  12. typedef struct xml_node_attr{
  13.     char *name;
  14.     char *value;
  15.    
  16.     struct xml_node_attr *next;
  17. }xml_node_attr;
  18.  
  19. typedef struct xml_node{
  20.     char *name;
  21.     char *value;
  22.     int level;
  23.     long start_pos;
  24.     long end_pos;
  25.     char closed;
  26.  
  27.  
  28.     struct xml_node_attr *attrs;
  29.     struct xml_node *next;
  30.     struct xml_node *last;
  31.     struct xml_node *child;
  32.     struct xml_node *parent;
  33. }xml_node;
  34.  
  35. int XML_Open(char *path);
  36.  
  37. struct xml_node *XML_ParseAll();
  38. struct xml_node *XML_SearchNodeFrom(char *name, struct xml_node *start);
  39. struct xml_node *XML_SearchNode(char *name);
  40. struct xml_node *XML_GetChild(struct xml_node *node);
  41. struct xml_node *XML_GetNextNode(struct xml_node *node);
  42.  
  43. struct xml_node_attr *XML_GetNodeAttr(struct xml_node *node, char *name);
  44. char *XML_GetNodeValue(struct xml_node *node);
  45.  
  46. void XML_EndParse(char free_tree);
  47.  
  48. #endif
Advertisement
Add Comment
Please, Sign In to add comment