From: <ped...@us...> - 2007-08-06 22:28:46
|
Revision: 1047 http://cegcc.svn.sourceforge.net/cegcc/?rev=1047&view=rev Author: pedroalves Date: 2007-08-06 15:28:44 -0700 (Mon, 06 Aug 2007) Log Message: ----------- * mingwex/Makefile.in (WINCE_DISTFILES): Add lfind.c. (WINCE_OBJS): Add lfind.o. * mingwex/wince/lfind.c: New file. * include/search.h (_lfind, lfind): Expose. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/search.h trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/lfind.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-08-06 22:28:44 UTC (rev 1047) @@ -1,3 +1,10 @@ +2007-08-06 Pedro Alves <ped...@po...> + + * mingwex/Makefile.in (WINCE_DISTFILES): Add lfind.c. + (WINCE_OBJS): Add lfind.o. + * mingwex/wince/lfind.c: New file. + * include/search.h (_lfind, lfind): Expose. + 2007-06-24 Pedro Alves <ped...@po...> * mingwex/Makefile.in (WINCE_OBJS): Add chsize.o, findfile.o, Modified: trunk/cegcc/src/mingw/include/search.h =================================================================== --- trunk/cegcc/src/mingw/include/search.h 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/include/search.h 2007-08-06 22:28:44 UTC (rev 1047) @@ -43,7 +43,6 @@ /* bsearch and qsort are also declared in stdlib.h */ _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); -#ifndef __COREDLL__ _CRTIMP void* __cdecl _lfind (const void*, const void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); _CRTIMP void* __cdecl _lsearch (const void*, void*, unsigned int*, unsigned int, @@ -54,7 +53,6 @@ _CRTIMP void* __cdecl lsearch (const void*, void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); #endif -#endif /* Not __COREDLL__ */ #ifdef __cplusplus } Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-08-06 22:28:44 UTC (rev 1047) @@ -88,7 +88,7 @@ asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \ tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c \ close.c isalnum.c isalpha.c iscntrl.c isgraph.c islower.c isprint.c \ - ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c + ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c lfind.c MATHCE_DISTFILES = \ e_acosf.c e_acosh.c e_acoshf.c e_asinf.c e_atan2f.c e_atanh.c e_coshf.c \ @@ -217,7 +217,7 @@ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o \ mb_cur_max.o rename.o stat.o chmod.o utime.o futime.o timeutil.o \ - ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o + ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o lfind.o MATHCE_OBJS = \ e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ Added: trunk/cegcc/src/mingw/mingwex/wince/lfind.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lfind.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/lfind.c 2007-08-06 22:28:44 UTC (rev 1047) @@ -0,0 +1,65 @@ +/* $Id: lfind.c,v 1.3 2005/12/27 15:08:22 dron Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Roger L. Snyder. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: lsearch.c,v 1.2 2005/07/06 15:47:15 drochner Exp $"); +#endif + +#include <sys/types.h> + +#ifndef NULL +# define NULL 0 +#endif + +void * +_lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + char *element, *end; + + end = (char *)base + *nmemb * size; + for (element = (char *)base; element < end; element += size) + if (!compar(element, key)) /* key found */ + return element; + + return NULL; +} + +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + return _lfind(key, base, nmemb, size, compar); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/lfind.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |