parameters.h 2.82 KB
Newer Older
1 2 3 4 5 6
/*
	belle-sip - SIP (RFC3261) library.
    Copyright (C) 2010  Belledonne Communications SARL

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
7
    the Free Software Foundation, either version 2 of the License, or
8 9 10 11 12 13 14 15 16 17 18 19 20 21
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PARAMETERS_H_
#define PARAMETERS_H_

Ghislain MARY's avatar
Ghislain MARY committed
22
#include "belle-sip/utils.h"
23
#include "belle-sip/list.h"
24 25 26

BELLE_SIP_BEGIN_DECLS

27 28 29 30 31
/***
 *  parameters
 *
 */

32
belle_sip_parameters_t* belle_sip_parameters_new(void);
jehan's avatar
jehan committed
33 34
/*
 * remove all parameters */
Sylvain Berfini's avatar
Sylvain Berfini committed
35
BELLESIP_EXPORT void belle_sip_parameters_clean(belle_sip_parameters_t* params);
jehan's avatar
jehan committed
36

jehan's avatar
jehan committed
37
/*BELLESIP_EXPORT void belle_sip_parameters_destroy(belle_sip_parameters_t* params);*/
38

39
BELLESIP_EXPORT const char*	belle_sip_parameters_get_parameter(const belle_sip_parameters_t* obj,const char* name);
jehan's avatar
jehan committed
40 41
/*
 * same as #belle_sip_parameters_get_parameter but name is case insensitive */
42
BELLESIP_EXPORT const char*	belle_sip_parameters_get_case_parameter(const belle_sip_parameters_t* params,const char* name);
jehan's avatar
jehan committed
43

44 45 46
/**
 * returns 0 if not found
 */
47
BELLESIP_EXPORT unsigned int belle_sip_parameters_has_parameter(const belle_sip_parameters_t* obj,const char* name);
48

Sylvain Berfini's avatar
Sylvain Berfini committed
49
BELLESIP_EXPORT void	belle_sip_parameters_set_parameter(belle_sip_parameters_t* obj,const char* name,const char* value);
50

51 52 53 54 55 56 57
/**
 * Assign a full set of parameters to the belle_sip_parameters_t object.
 * Parameters are given as string of key=value pairs separated with semicolons, where value is optional.
 * @example belle_sip_parameters_set(parameters,"param1=value1;param2;param3=value3");
**/
BELLESIP_EXPORT void belle_sip_parameters_set(belle_sip_parameters_t *parameters, const char* params);

58
BELLESIP_EXPORT const belle_sip_list_t *	belle_sip_parameters_get_parameter_names(const belle_sip_parameters_t* obj);
59

60
BELLESIP_EXPORT const belle_sip_list_t *	belle_sip_parameters_get_parameters(const belle_sip_parameters_t* obj);
61

62
BELLESIP_EXPORT void	belle_sip_parameters_remove_parameter(belle_sip_parameters_t* obj,const char* name);
63

64
BELLESIP_EXPORT belle_sip_error_code belle_sip_parameters_marshal(const belle_sip_parameters_t* obj, char* buff, size_t buff_size, size_t *offset);
65

66 67
BELLESIP_EXPORT void belle_sip_parameters_copy_parameters_from(belle_sip_parameters_t *params, const belle_sip_parameters_t *orig);

68 69
#define BELLE_SIP_PARAMETERS(obj) BELLE_SIP_CAST(obj,belle_sip_parameters_t)

70 71
BELLE_SIP_END_DECLS

72
#endif /*PARAMETERS_H_*/
73