Rename sofia_glue_get_user_host to switch_split_user_domain

and move to switch_utils. To allow use by other modules.
This commit is contained in:
Mathieu Parent
2010-06-02 01:09:54 +02:00
parent a291af5768
commit 3f7cafd709
8 changed files with 57 additions and 48 deletions
+10
View File
@@ -640,6 +640,16 @@ SWITCH_DECLARE(int) switch_inet_pton(int af, const char *src, void *dst);
SWITCH_DECLARE(int) switch_number_cmp(const char *exp, int val);
/*!
\brief Split a user@domain string as user and domain
\param in the input string
\param user the string to put the user into
\param domain the string to put the domain into
\return 1 if successfull
\note Extended formats protocol:user@domain:port (Example: sip:toto@example.org)
*/
int switch_split_user_domain(char *in, char **user, char **domain);
/* malloc or DIE macros */
#ifdef NDEBUG
#define switch_malloc(ptr, len) (void)( (!!(ptr = malloc(len))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%s", __FILE__, __LINE__),abort(), 0), ptr )