forked from OpenSIPS/opensips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrcommon.h
59 lines (49 loc) · 1.94 KB
/
strcommon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright (C) 2007 voice-system.ro
*
* This file is part of opensips, a free SIP server.
*
* opensips 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 2 of the License, or
* (at your option) any later version
*
* opensips 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/*!
* \file
* \brief Common string handling functions
*/
#ifndef _STRCOMMON_H_
#define _STRCOMMON_H_
#include "str.h"
#include "md5.h"
#include "crc.h"
#include "lib/str2const.h"
/*
* add backslashes to special characters
*/
int escape_common(char *dst, const char *src, int src_len);
/*
* remove backslashes to special characters
*/
int unescape_common(char *dst, const char *src, int src_len);
int unescape_xml(char *dst, const char *src, int src_len);
void compute_md5(char *dst, const char *src, int src_len);
int _escape_user(const str_const *sin, str *sout);
static inline int _escape_userSS(const str *sin, str *sout){return _escape_user(str2const(sin), sout);}
int _unescape_user(const str_const *sin, str *sout);
static inline int _unescape_userSS(const str *sin, str *sout){return _unescape_user(str2const(sin), sout);}
int _escape_param(const str_const *sin, str *sout);
static inline int _escape_paramSS(const str *sin, str *sout){return _escape_param(str2const(sin), sout);}
int _unescape_param(const str_const *sin, str *sout);
static inline int _unescape_paramSS(const str *sin, str *sout){return _unescape_param(str2const(sin), sout);}
#endif