tsdp_header_A.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 tsdp_header_A.h
  23. * @brief SDP "a=" header (Attributes).
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. *
  28. */
  29. #ifndef _TSDP_HEADER_A_H_
  30. #define _TSDP_HEADER_A_H_
  31. #include "tinysdp_config.h"
  32. #include "tinysdp/headers/tsdp_header.h"
  33. TSDP_BEGIN_DECLS
  34. #define TSDP_HEADER_A_VA_ARGS(field, value) tsdp_header_A_def_t, (const char*)(field), (const char*)(value)
  35. #define TSDP_HEADER_A(self) ((tsdp_header_A_t*)(self))
  36. ////////////////////////////////////////////////////////////////////////////////////////////////////
  37. /// @struct
  38. ///
  39. /// @brief SDP "a=" header (Attributes).
  40. ///
  41. /// @par ABNF : a=attribute
  42. /// attribute = (att-field ":" att-value) / att-field
  43. /// att-field = token
  44. /// att-value = byte-string
  45. ///
  46. ////////////////////////////////////////////////////////////////////////////////////////////////////
  47. typedef struct tsdp_header_A_s {
  48. TSDP_DECLARE_HEADER;
  49. char* field;
  50. char* value;
  51. }
  52. tsdp_header_A_t;
  53. typedef tsk_list_t tsdp_headers_A_L_t;
  54. TINYSDP_API tsdp_header_A_t* tsdp_header_A_create(const char* field, const char* value);
  55. TINYSDP_API tsdp_header_A_t* tsdp_header_A_create_null();
  56. TINYSDP_API tsdp_header_A_t *tsdp_header_A_parse(const char *data, tsk_size_t size);
  57. TINYSDP_API int tsdp_header_A_removeAll_by_field(tsdp_headers_A_L_t *attributes, const char* field);
  58. TINYSDP_API int tsdp_header_A_removeAll_by_fields(tsdp_headers_A_L_t *attributes, const char** fields, tsk_size_t fields_count);
  59. TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_A_def_t;
  60. TSDP_END_DECLS
  61. #endif /* _TSDP_HEADER_A_H_ */