/parsed_xpath.h

http://github.com/fizx/parsley · C Header · 34 lines · 28 code · 6 blank · 0 comment · 0 complexity · 76f4281272902db921299ec7610b5481 MD5 · raw file

  1. #ifndef _parsed_xpath_h_
  2. #define _parsed_xpath_h_
  3. #include <stdarg.h>
  4. typedef struct __pxpath_node {
  5. int type;
  6. char* value;
  7. struct __pxpath_node * next;
  8. struct __pxpath_node * child;
  9. } pxpath_node;
  10. typedef pxpath_node * pxpathPtr;
  11. enum {
  12. PXPATH_FUNCTION = 1,
  13. PXPATH_PATH = 2,
  14. PXPATH_LITERAL = 3,
  15. PXPATH_LIT_EXPR = 4,
  16. PXPATH_OPERATOR = 3
  17. };
  18. pxpathPtr pxpath_new(int type, char* value);
  19. pxpathPtr pxpath_new_func(char* value, pxpathPtr child);
  20. pxpathPtr pxpath_cat_paths(int n, ...);
  21. pxpathPtr pxpath_cat_literals(int n, ...);
  22. pxpathPtr pxpath_new_path(int n, ...);
  23. pxpathPtr pxpath_dup(pxpathPtr p);
  24. pxpathPtr pxpath_new_literal(int n, ...);
  25. pxpathPtr pxpath_new_operator(int n, ...);
  26. void pxpath_free(pxpathPtr ptr);
  27. char* pxpath_to_string(pxpathPtr ptr);
  28. #endif