parameters.h 2.25 KB
Newer Older
jehan's avatar
jehan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
	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
    the Free Software Foundation, either version 3 of the License, or
    (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"
jehan's avatar
jehan committed
23 24 25 26 27 28 29 30 31
#include "belle-sip/list.h"
/***
 *  parameters
 *
 */

typedef struct _belle_sip_parameters belle_sip_parameters_t;

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

jehan's avatar
jehan committed
36

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

jehan's avatar
jehan committed
42 43 44
/**
 * returns 0 if not found
 */
45
BELLESIP_EXPORT unsigned int belle_sip_parameters_has_parameter(const belle_sip_parameters_t* obj,const char* name);
jehan's avatar
jehan committed
46

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

49
BELLESIP_EXPORT const belle_sip_list_t *	belle_sip_parameters_get_parameter_names(const belle_sip_parameters_t* obj);
jehan's avatar
jehan committed
50

51
BELLESIP_EXPORT const belle_sip_list_t *	belle_sip_parameters_get_parameters(const belle_sip_parameters_t* obj);
jehan's avatar
jehan committed
52

53
BELLESIP_EXPORT void	belle_sip_parameters_remove_parameter(belle_sip_parameters_t* obj,const char* name);
jehan's avatar
jehan committed
54

Ghislain MARY's avatar
Ghislain MARY committed
55
BELLESIP_EXPORT belle_sip_error_code belle_sip_parameters_marshal(const belle_sip_parameters_t* obj, char* buff, size_t buff_size, unsigned int *offset);
jehan's avatar
jehan committed
56

jehan's avatar
jehan committed
57 58 59
#define BELLE_SIP_PARAMETERS(obj) BELLE_SIP_CAST(obj,belle_sip_parameters_t)

#endif /*PARAMETERS_H_*/
60