txcap_node.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou [at) doubango (DOT) org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file txcap_node.h
  23. * @brief XCAP nodes.
  24. *
  25. * @author Mamadou Diop <diopmamadou [at) doubango (DOT) org>
  26. *
  27. */
  28. #ifndef TINYXCAP_TXCAP_NODE_H
  29. #define TINYXCAP_TXCAP_NODE_H
  30. #include "tinyxcap_config.h"
  31. #include "tsk_common.h"
  32. #include <stdarg.h> /* va_list* */
  33. TXCAP_BEGIN_DECLS
  34. typedef enum txcap_selector_param_type_e {
  35. xcapp_node_null = 0,
  36. xcapp_node_name,
  37. xcapp_node_pos,
  38. xcapp_node_attribute,
  39. xcapp_node_pos_n_attribute,
  40. xcapp_node_namespace
  41. }
  42. txcap_selector_param_type_t;
  43. /**@ingroup txcap_selector_group
  44. * @def TXCAP_SELECTOR_NODE_SET_NAME
  45. * Node selection step. Selects by name as per <a href="http://tools.ietf.org/html/rfc4825#section-6.3">RFC 4825 subclause 6.3</a>.
  46. * @param QNAME_STR The name of the node to select. The @a QName grammar is defined in the XML namespaces [<a href="http://tools.ietf.org/html/rfc4825#ref-3">3</a>] specification (<i>const char*</i>).
  47. */
  48. /**@ingroup txcap_selector_group
  49. * @def TXCAP_SELECTOR_NODE_SET_POS
  50. * Node selection step. Selects by position as per <a href="http://tools.ietf.org/html/rfc4825#section-6.3">RFC 4825 subclause 6.3</a>.
  51. * @param QNAME_STR The name of the node to select. The @a QName grammar is defined in the XML namespaces [<a href="http://tools.ietf.org/html/rfc4825#ref-3">3</a>] specification.
  52. * @param POS_UINT The position of the node to select (1*DIGIT) (<i>unsigned int</i>).
  53. */
  54. /**@ingroup txcap_selector_group
  55. * @def TXCAP_SELECTOR_NODE_SET_ATTRIBUTE
  56. * Node selection step. Selects by position and attribute as per <a href="http://tools.ietf.org/html/rfc4825#section-6.3">RFC 4825 subclause 6.3</a>.
  57. * @param QNAME_STR The name of the node to select. The @a QName grammar is defined in the XML namespaces [<a href="http://tools.ietf.org/html/rfc4825#ref-3">3</a>] specification (<i>const char*</i>).
  58. * @param ATT_QNAME_STR The name of the attribute (<i>const char*</i>).
  59. * @param ATT_VALUE_STR The value of the attribute. @a AttValue grammar is defined in the XML specification XML 1.0 [<a href="http://tools.ietf.org/html/rfc4825#ref-1">1</a>] (<i>const char*</i>).
  60. */
  61. /**@ingroup txcap_selector_group
  62. * @def TXCAP_SELECTOR_NODE_SET_POS_ATTRIBUTE
  63. * Node selection step. Selects by position and attribute as per <a href="http://tools.ietf.org/html/rfc4825#section-6.3">RFC 4825 subclause 6.3</a>.
  64. * @param QNAME_STR The name of the node to select. The @a QName grammar is defined in the XML namespaces [<a href="http://tools.ietf.org/html/rfc4825#ref-3">3</a>] specification.
  65. * @param POS_UINT The position of the node to select (1*DIGIT) (<i>unsigned int</i>).
  66. * @param ATT_QNAME_STR The name of the attribute (<i>const char*</i>).
  67. * @param ATT_VALUE_STR The value of the attribute. @a AttValue grammar is defined in the XML specification XML 1.0 [<a href="http://tools.ietf.org/html/rfc4825#ref-1">1</a>] (<i>const char*</i>).
  68. */
  69. /**@ingroup txcap_selector_group
  70. * @def TXCAP_SELECTOR_NODE_SET_NAMESPACE
  71. * Node selection step. Appends XML namespace("namespace::*") as per <a href="http://tools.ietf.org/html/rfc4825#section-6.3">RFC 4825 subclause 6.3</a>.
  72. * @param PREFIX_STR The prefix to use for this namespace (<i>const char*</i>).
  73. * @param VALUE_STR The value of the namespace (<i>const char*</i>).
  74. */
  75. /**@ingroup txcap_selector_group
  76. * @def TXCAP_SELECTOR_NODE_SET_NULL
  77. * Ends node selection steps. Must always be present and should be the last one.
  78. */
  79. #define TXCAP_SELECTOR_NODE_SET_NAME(QNAME_STR) xcapp_node_name, (const char*)QNAME_STR
  80. #define TXCAP_SELECTOR_NODE_SET_POS(QNAME_STR, POS_UINT) xcapp_node_pos, (const char*)QNAME_STR, (unsigned int)POS_UINT
  81. #define TXCAP_SELECTOR_NODE_SET_ATTRIBUTE(QNAME_STR, ATT_QNAME_STR, ATT_VALUE_STR) xcapp_node_attribute, (const char*)QNAME_STR, (const char*)ATT_QNAME_STR, (const char*)ATT_VALUE_STR
  82. #define TXCAP_SELECTOR_NODE_SET_POS_ATTRIBUTE(QNAME_STR, POS_UINT, ATT_QNAME_STR, ATT_VALUE_STR) xcapp_node_pos_n_attribute, (const char*)QNAME_STR, (unsigned int)POS_UINT, (const char*)ATT_QNAME_STR, (const char*)ATT_VALUE_STR
  83. #define TXCAP_SELECTOR_NODE_SET_NAMESPACE(PREFIX_STR, VALUE_STR) xcapp_node_namespace, (const char*)PREFIX_STR, (const char*)VALUE_STR
  84. #define TXCAP_SELECTOR_NODE_SET_NULL() xcapp_node_null
  85. TINYXCAP_API char* txcap_selector_get_node(const char* auid_id, ...);
  86. TINYXCAP_API char* txcap_selector_get_node_2(const char* auid_id, va_list* app);
  87. TXCAP_END_DECLS
  88. #endif /* TINYXCAP_TXCAP_NODE_H */