diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-06-13 10:20:48 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-06-13 10:20:48 +0000 |
commit | dc8971488e7c174ab4084cbdb0a8f12c39b738d7 (patch) | |
tree | d679387fa379b6d5feb9756bdd7237347614453b /winsup/mingw/mingwex/wmemchr.c | |
parent | 5f74ae83e5fba1ceb73a8d822cbe2b48c619127f (diff) | |
download | cygnal-dc8971488e7c174ab4084cbdb0a8f12c39b738d7.tar.gz cygnal-dc8971488e7c174ab4084cbdb0a8f12c39b738d7.tar.bz2 cygnal-dc8971488e7c174ab4084cbdb0a8f12c39b738d7.zip |
* include/_mingw.h: Increment version to 2.0.
* Makefile.in: Ditto.
Merge in mingwex branch.
Diffstat (limited to 'winsup/mingw/mingwex/wmemchr.c')
-rw-r--r-- | winsup/mingw/mingwex/wmemchr.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/wmemchr.c b/winsup/mingw/mingwex/wmemchr.c new file mode 100644 index 000000000..dc5cedd23 --- /dev/null +++ b/winsup/mingw/mingwex/wmemchr.c @@ -0,0 +1,28 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + +wchar_t* +wmemchr(s, c, n) + register const wchar_t *s; + register wchar_t c; + register size_t n; + { + if ( s != NULL ) + for ( ; n > 0; ++s, --n ) + if ( *s == c ) + return (wchar_t *)s; + + return NULL; + } + |