1 /* 2 The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 */ 19 20 #ifndef _OSIP_ACCEPT_LANGUAGE_H_ 21 #define _OSIP_ACCEPT_LANGUAGE_H_ 22 23 #include <osipparser2/headers/osip_accept_encoding.h> 24 25 /** 26 * @file osip_accept_language.h 27 * @brief oSIP osip_accept_language header definition. 28 */ 29 30 /** 31 * @defgroup oSIP_ACCEPT_LANGUAGE oSIP accept-language header definition. 32 * @ingroup oSIP_HEADERS 33 * @{ 34 */ 35 36 /** 37 * Structure for Accept-Language headers. 38 * @var osip_accept_language_t 39 */ 40 typedef osip_accept_encoding_t osip_accept_language_t; 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * Allocate an Accept-Language element. 48 * @param header The element to work on. 49 */ 50 #define osip_accept_language_init(header) osip_accept_encoding_init(header) 51 /** 52 * Parse an Accept-Language element. 53 * @param header The element to work on. 54 * @param hvalue The string to parse. 55 */ 56 #define osip_accept_language_parse(header, hvalue) osip_accept_encoding_parse(header, hvalue) 57 /** 58 * Get a string representation of an Accept-Language element. 59 * @param header The element to work on. 60 * @param dest A pointer on the new allocated string. 61 */ 62 #define osip_accept_language_to_str osip_accept_encoding_to_str 63 /** 64 * Free an Accept-Language element. 65 * @param header The element to work on. 66 */ 67 #define osip_accept_language_free osip_accept_encoding_free 68 /** 69 * Clone an Accept-Language element. 70 * @param header The element to work on. 71 * @param dest A pointer on the copy of the element. 72 */ 73 #define osip_accept_language_clone osip_accept_encoding_clone 74 75 /** 76 * Get the value of an Accept-Language element. 77 * @param header The element to work on. 78 */ 79 #define osip_accept_language_get_element(header) osip_accept_encoding_get_element(header) 80 /** 81 * Set the value of an Accept-Language element. 82 * @param header The element to work on. 83 * @param value The value to set. 84 */ 85 #define osip_accept_language_set_element(header, value) osip_accept_encoding_set_element(header, value) 86 /** 87 * Allocate and add a generic parameter element in an Accept-Language element. 88 * @param header The element to work on. 89 * @param name The token name. 90 * @param value The token value. 91 */ 92 #define osip_accept_language_param_add(header, name, value) osip_generic_param_add((&(header)->gen_params), name, value) 93 /** 94 * Find a header parameter in a Accept-Language element. 95 * @param header The element to work on. 96 * @param name The token name to search. 97 * @param dest A pointer on the element found. 98 */ 99 #define osip_accept_language_param_get_byname(header, name, dest) osip_generic_param_get_byname((&(header)->gen_params), name, dest) 100 101 #ifdef __cplusplus 102 } 103 #endif 104 105 /** @} */ 106 107 #endif 108