Code Search for Developers
 
 
  

misc.c from aMSN at Krugle


Show misc.c syntax highlighted

#include "config.h"

#include <stdio.h>
#include <stdlib.h>

#include "grab-ng.h"
#include "misc.h"

/* ------------------------------------------------------------------------ */
/* prehistoric libc ;)                                                      */

#ifndef HAVE_STRCASESTR
char* __used strcasestr(char *haystack, char *needle)
{
    int hlen = strlen(haystack);
    int nlen = strlen(needle);
    int offset;

    for (offset = 0; offset <= hlen - nlen; offset++)
	if (0 == strncasecmp(haystack+offset,needle,nlen))
	    return haystack+offset;
    return NULL;
}
#endif

#ifndef HAVE_MEMMEM
void __used *memmem(unsigned char *haystack, size_t haystacklen,
		    unsigned char *needle, size_t needlelen)
{
    int i;

    for (i = 0; i < haystacklen - needlelen; i++)
	if (0 == memcmp(haystack+i,needle,needlelen))
	    return haystack+i;
    return NULL;
}
#endif




See more files for this project here

aMSN

A very nice MSN compatible messenger application, aMSN Messenger is a multiplatform MSN messenger clone. Works pretty much like its Windows based counterpart. Perfect for keeping in touch with those friends who have not yet seen the light. Works on linux

Project homepage: http://sourceforge.net/projects/amsn
Programming language(s): C,C++,PHP,Tcl,XML
License: other

  plugins/
    Makefile
    Rules.mk
    conv-mjpeg.c
    drv0-bsd.c
    drv0-v4l2-old.c
    drv0-v4l2.c
    drv1-v4l.c
    sn9c10x.c
  Makefile
  OVERVIEW
  README
  Rules.mk
  byteswap.h
  color_common.c
  color_lut.c
  color_packed.c
  color_unused.c
  color_yuv2rgb.c
  convert.c
  devices.c
  devices.h
  grab-ng.c
  grab-ng.h
  list.h
  misc.c
  misc.h
  parse-dvb.c
  parse-mpeg.c
  parse-mpeg.h
  videodev.h
  videodev2-old.h
  videodev2.h
  writefile.c
  writefile.h