[SR-Users] Comparing strings

AliReza Khoshgoftar Monfared khoshgoftar at gmail.com
Fri Jul 11 23:50:28 CEST 2014


Here is the definition for cmp_str(), for example:

static int cmp_str_f(struct sip_msg *msg, char *str1, char *str2 )
> {
>     str s1;
>     str s2;
>     int ret;
>
>     if(fixup_get_svalue(msg, (gparam_p)str1, &s1)!=0)
>     {
>         LM_ERR("cannot get first parameter\n");
>         return -8;
>     }
>     if(fixup_get_svalue(msg, (gparam_p)str2, &s2)!=0)
>     {
>         LM_ERR("cannot get second parameter\n");
>         return -8;
>     }
>     ret = cmp_str(&s1, &s2);
>     if(ret==0)
>         return 1;
>     if(ret>0)
>         return -1;
>     return -2;
> }
>

i guess rather than the ability to use error codes, and the fact that one
function does case sensitive and the other case insensitive, there's no
tangible difference with ==

On Fri, Jul 11, 2014 at 5:30 PM, Alex Balashov <abalashov at evaristesys.com>
wrote:

> str
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140711/c04eb555/attachment.html>


More information about the sr-users mailing list