strcommon.c File Reference

Generic string handling functions. More...

#include "ut.h"
#include "strcommon.h"

Include dependency graph for strcommon.c:

Go to the source code of this file.

Functions

void compute_md5 (char *dst, char *src, int src_len)
 Compute MD5 checksum.
int escape_common (char *dst, char *src, int src_len)
 add backslashes to special characters
int escape_param (str *sin, str *sout)
 Escape all printable characters that are not valid in a param part of request uri: = | ; | , | | " | ? | &.
int escape_user (str *sin, str *sout)
 Escape all printable characters that are not valid in user part of request uri no_need_to_escape = unreserved | user-unreserved unreserved = aplhanum | mark mark = - | _ | . | ! | ~ | * | ' | ( | ) user-unreserved = & | = | + | $ | , | ; | ? | /.
int unescape_common (char *dst, char *src, int src_len)
 remove backslashes to special characters
int unescape_param (str *sin, str *sout)
int unescape_user (str *sin, str *sout)
 Unscape all printable ASCII characters.


Detailed Description

Generic string handling functions.

Definition in file strcommon.c.


Function Documentation

void compute_md5 ( char *  dst,
char *  src,
int  src_len 
)

Compute MD5 checksum.

Definition at line 114 of file strcommon.c.

References MD5Init(), MD5Update(), string2hex(), and U_MD5Final().

int escape_common ( char *  dst,
char *  src,
int  src_len 
)

add backslashes to special characters

Definition at line 35 of file strcommon.c.

Referenced by db_unixodbc_val2str().

int escape_param ( str sin,
str sout 
)

Escape all printable characters that are not valid in a param part of request uri: = | ; | , | | " | ? | &.

Definition at line 317 of file strcommon.c.

References _str::len, LM_DBG, LM_ERR, NULL, s, and _str::s.

int escape_user ( str sin,
str sout 
)

Escape all printable characters that are not valid in user part of request uri no_need_to_escape = unreserved | user-unreserved unreserved = aplhanum | mark mark = - | _ | . | ! | ~ | * | ' | ( | ) user-unreserved = & | = | + | $ | , | ; | ? | /.

Definition at line 236 of file strcommon.c.

References _str::len, LM_DBG, LM_ERR, NULL, s, and _str::s.

int unescape_common ( char *  dst,
char *  src,
int  src_len 
)

remove backslashes to special characters

Definition at line 72 of file strcommon.c.

int unescape_param ( str sin,
str sout 
)

Definition at line 307 of file strcommon.c.

References unescape_user().

int unescape_user ( str sin,
str sout 
)

Unscape all printable ASCII characters.

Definition at line 125 of file strcommon.c.

References _str::len, LM_DBG, LM_ERR, NULL, s, and _str::s.

Referenced by unescape_param().


Generated on Thu May 24 14:00:43 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6