Logo Search packages:      
Sourcecode: sofia-sip version File versions

void* memmem ( const void *  haystack,
size_t  haystacklen,
const void *  needle,
size_t  needlelen 
)

NUA-12 tests: SUBSCRIBE/NOTIFY.

test_sip_events.c

Author:
Pekka Pessi <Pekka.Pessi@nokia.com>

Martti Mela <Martti Mela@nokia.com>

Date:
Created: Wed Aug 17 12:12:12 EEST 2005 ppessi

Definition at line 39 of file memmem.c.

Referenced by msg_multipart_parse().

{
  size_t i;
  char const *hs = haystack;

  if (needlelen == 0)
    return (void *)haystack;

  if (needlelen > haystacklen || haystack == NULL || needle == NULL)
    return NULL;

  for (i = 0; i <= haystacklen - needlelen; i++) {
    if (memcmp(hs + i, needle, needlelen) == 0)
      return (void *)(hs + i);
  }

  return NULL;
}


Generated by  Doxygen 1.6.0   Back to index