xml_utils.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2005 iptelorg GmbH
  3. *
  4. * This file is part of ser, a free SIP server.
  5. *
  6. * ser is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version
  10. *
  11. * For a license to use the ser software under conditions
  12. * other than those described here, or to purchase support for this
  13. * software, please contact iptel.org by e-mail at the following addresses:
  14. * [email protected]
  15. *
  16. * ser is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. */
  25. #include <libxml/parser.h>
  26. #include <libxml/tree.h>
  27. #include <cds/sstr.h>
  28. int xmlstrcmp(const xmlChar *xmls, const char *name);
  29. xmlAttr *find_attr(xmlAttr *first, const char *name);
  30. const char *find_value(xmlNode *first_child);
  31. const char *get_node_value(xmlNode *n);
  32. xmlNode *find_node(xmlNode *parent, const char *name, const char *nspace);
  33. const char *get_attr_value(xmlAttr *a);
  34. int cmp_node(xmlNode *node, const char *name, const char *nspace);
  35. int get_int_attr(xmlNode *n, const char *attr_name, int *dst);
  36. int get_str_attr(xmlNode *n, const char *attr_name, str_t *dst);
  37. time_t xmltime2time(const char *xt);
  38. #define SEQUENCE(type) type*
  39. #define SEQUENCE_ABLE(type) type *__next;
  40. #define SEQUENCE_ADD(first,last,e) do { \
  41. if (last) last->__next = e; \
  42. else first = e; \
  43. last = e; } while(0);
  44. #define SEQUENCE_FIRST(first) first
  45. #define SEQUENCE_NEXT(e) (e)->__next
  46. extern int xml_parser_flags;