Add some missing files. Trunk is still not buildable

svn path=/trunk/; revision=26106
This commit is contained in:
Hervé Poussineau 2007-03-15 10:58:19 +00:00
parent b51c90e8d2
commit 17dd2f5904
72 changed files with 1381 additions and 41 deletions

View file

@ -45,16 +45,16 @@
<file>abnorter.c</file>
<file>exhand2.c</file>
<file>matherr.c</file>
<if property="ARCH" value="i386">
<directory name="i386">
<file>seh.s</file>
<file>unwind.c</file>
</directory>
</if>
<if property="ARCH" value="i386">
<directory name="i386">
<file>seh.s</file>
<file>unwind.c</file>
</directory>
</if>
<file>xcptfil.c</file>
</directory>
<directory name="float">
<file>chgsign.c</file>
<file>chgsign.c</file>
<file>copysign.c</file>
<file>fpclass.c</file>
<file>fpecode.c</file>
@ -62,15 +62,14 @@
<file>isnan.c</file>
<file>nafter.c</file>
<file>scalb.c</file>
<if property="ARCH" value="i386">
<directory name="i386">
<file>clearfp.c</file>
<file>cntrlfp.c</file>
<file>logb.c</file>
<file>statfp.c</file>
</directory>
</if>
<if property="ARCH" value="i386">
<directory name="i386">
<file>clearfp.c</file>
<file>cntrlfp.c</file>
<file>logb.c</file>
<file>statfp.c</file>
</directory>
</if>
</directory>
<directory name="io">
<file>access.c</file>
@ -118,35 +117,35 @@
<directory name="math">
<file>acos.c</file>
<file>adjust.c</file>
<file>asin.c</file>
<file>asin.c</file>
<file>cabs.c</file>
<file>cosh.c</file>
<file>cosh.c</file>
<file>frexp.c</file>
<file>huge_val.c</file>
<file>hypot.c</file>
<file>j0_y0.c</file>
<file>j1_y1.c</file>
<file>jn_yn.c</file>
<file>modf.c</file>
<file>jn_yn.c</file>
<file>modf.c</file>
<file>s_modf.c</file>
<file>sinh.c</file>
<file>stubs.c</file>
<file>tanh.c</file>
<file>pow_asm.c</file>
<file>pow_asm.c</file>
<if property="ARCH" value="i386">
<directory name="i386">
<file>atan2.c</file>
<file>exp.c</file>
<file>fmod.c</file>
<file>ldexp.c</file>
<file>atan_asm.s</file>
<file>pow_asm.s</file>
<file>log10_asm.s</file>
</directory>
</if>
<ifnot property="ARCH" value="i386">
</ifnot>
<if property="ARCH" value="i386">
<directory name="i386">
<file>atan2.c</file>
<file>exp.c</file>
<file>fmod.c</file>
<file>ldexp.c</file>
<file>atan_asm.s</file>
<file>pow_asm.s</file>
<file>log10_asm.s</file>
</directory>
</if>
<ifnot property="ARCH" value="i386">
</ifnot>
</directory>
<directory name="mbstring">
@ -233,15 +232,13 @@
<file>lfind.c</file>
<file>lsearch.c</file>
</directory>
<directory name="setjmp">
<if property="ARCH" value="i386">
<directory name="i386">
<file>setjmp.s</file>
</directory>
</if>
<if property="ARCH" value="i386">
<directory name="i386">
<file>setjmp.s</file>
</directory>
</if>
</directory>
<directory name="signal">
<file>signal.c</file>
<file>xcptinfo.c</file>
@ -357,11 +354,71 @@
<file>wmakpath.c</file>
</directory>
<directory name="string">
<if property="ARCH" value="i386">
<directory name="i386">
<file>memchr_asm.s</file>
<file>memcpy_asm.s</file>
<file>memmove_asm.s</file>
<file>memset_asm.s</file>
<file>strcat_asm.s</file>
<file>strchr_asm.s</file>
<file>strcmp_asm.s</file>
<file>strcpy_asm.s</file>
<file>strlen_asm.s</file>
<file>strncat_asm.s</file>
<file>strncmp_asm.s</file>
<file>strncpy_asm.s</file>
<file>strnlen_asm.s</file>
<file>strrchr_asm.s</file>
<file>wcscat_asm.s</file>
<file>wcschr_asm.s</file>
<file>wcscmp_asm.s</file>
<file>wcscpy_asm.s</file>
<file>wcslen_asm.s</file>
<file>wcsncat_asm.s</file>
<file>wcsncmp_asm.s</file>
<file>wcsncpy_asm.s</file>
<file>wcsnlen_asm.s</file>
<file>wcsrchr_asm.s</file>
</directory>
</if>
<ifnot property="ARCH" value="i386">
<file>memchr.c</file>
<file>memcpy.c</file>
<file>memmove.c</file>
<file>memset.c</file>
<file>strcat.c</file>
<file>strchr.c</file>
<file>strcmp.c</file>
<file>strcpy.c</file>
<file>strlen.c</file>
<file>strncat.c</file>
<file>strncmp.c</file>
<file>strncpy.c</file>
<file>strnlen.c</file>
<file>strrchr.c</file>
<file>wcscat.c</file>
<file>wcschr.c</file>
<file>wcscmp.c</file>
<file>wcscpy.c</file>
<file>wcslen.c</file>
<file>wcsncat.c</file>
<file>wcsncmp.c</file>
<file>wcsncpy.c</file>
<file>wcsnlen.c</file>
<file>wcsrchr.c</file>
</ifnot>
<file>lasttok.c</file>
<file>memcmp.c</file>
<file>memicmp.c</file>
<file>strcoll.c</file>
<file>strdup.c</file>
<file>strerror.c</file>
<file>stricmp.c</file>
<file>strlwr.c</file>
<file>strncoll.c</file>
<file>strnicmp.c</file>
<file>strpbrk.c</file>
<file>strrev.c</file>
<file>strset.c</file>
<file>strstr.c</file>

View file

@ -0,0 +1,17 @@
/* $Id$
*/
#include <tchar.h>
_TCHAR * _tcscat(_TCHAR * s, const _TCHAR * append)
{
_TCHAR * save = s;
for(; *s; ++s);
while((*s++ = *append++));
return save;
}
/* EOF */

View file

@ -0,0 +1,22 @@
/* $Id$
*/
#include <tchar.h>
_TCHAR * _tcschr(const _TCHAR * s, _XINT c)
{
_TCHAR cc = c;
while(*s)
{
if(*s == cc) return (_TCHAR *)s;
s++;
}
if(cc == 0) return (_TCHAR *)s;
return 0;
}
/* EOF */

View file

@ -0,0 +1,19 @@
/* $Id$
*/
#include <tchar.h>
int _tcscmp(const _TCHAR* s1, const _TCHAR* s2)
{
while(*s1 == *s2)
{
if(*s1 == 0) return 0;
s1 ++;
s2 ++;
}
return *s1 - *s2;
}
/* EOF */

View file

@ -0,0 +1,13 @@
/* $Id$
*/
#include <tchar.h>
_TCHAR * _tcscpy(_TCHAR * to, const _TCHAR * from)
{
_TCHAR *save = to;
for (; (*to = *from); ++from, ++to);
return save;
}

View file

@ -0,0 +1,18 @@
/* $Id$
*/
#include <stddef.h>
#include <tchar.h>
size_t _tcslen(const _TCHAR * str)
{
const _TCHAR * s;
if(str == 0) return 0;
for(s = str; *s; ++ s);
return s - str;
}
/* EOF */

View file

@ -0,0 +1,30 @@
/* $Id$
*/
#include <stddef.h>
#include <tchar.h>
_TCHAR * _tcsncat(_TCHAR * dst, const _TCHAR * src, size_t n)
{
if(n != 0)
{
_TCHAR * d = dst;
const _TCHAR * s = src;
while(*d != 0) ++ d;
do
{
if((*d = *s++) == 0) break;
++ d;
}
while (--n != 0);
*d = 0;
}
return dst;
}
/* EOF */

View file

@ -0,0 +1,21 @@
/* $Id$
*/
#include <stddef.h>
#include <tchar.h>
int _tcsncmp(const _TCHAR * s1, const _TCHAR * s2, size_t n)
{
if(n == 0) return 0;
do
{
if(*s1 != *s2 ++) return *s1 - *-- s2;
if(*s1 ++ == 0) break;
}
while (-- n != 0);
return 0;
}
/* EOF */

View file

@ -0,0 +1,28 @@
/* $Id$
*/
#include <stddef.h>
#include <tchar.h>
_TCHAR * _tcsncpy(_TCHAR * dst, const _TCHAR * src, size_t n)
{
if(n != 0)
{
_TCHAR * d = dst;
const _TCHAR * s = src;
do
{
if((*d ++ = *s ++) == 0)
{
while (-- n != 0) *d ++ = 0;
break;
}
}
while(-- n != 0);
}
return dst;
}
/* EOF */

View file

@ -0,0 +1,18 @@
/* $Id$
*/
#include <stddef.h>
#include <tchar.h>
int _tcsnlen(const _TCHAR * str, size_t count)
{
const _TCHAR * s;
if(str == 0) return 0;
for(s = str; *s && count; ++ s, -- count);
return s - str;
}
/* EOF */

View file

@ -0,0 +1,22 @@
/* $Id$
*/
#include <tchar.h>
_TCHAR * _tcsrchr(const _TCHAR * s, _XINT c)
{
_TCHAR cc = c;
const _TCHAR * sp = (_TCHAR *)0;
while(*s)
{
if(*s == cc) sp = s;
s ++;
}
if(cc == 0) sp = s;
return (_TCHAR *)sp;
}
/* EOF */

View file

@ -0,0 +1,31 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/string/i386/memchr.s
*/
/*
* void* memchr(const void* s, int c, size_t n)
*/
.globl _memchr
_memchr:
push %ebp
mov %esp,%ebp
push %edi
mov 0x8(%ebp),%edi
mov 0xc(%ebp),%eax
mov 0x10(%ebp),%ecx
cld
repne scasb
je .L1
mov $1,%edi
.L1:
mov %edi,%eax
dec %eax
pop %edi
leave
ret

View file

@ -0,0 +1,48 @@
/*
* void *memcpy (void *to, const void *from, size_t count)
*
* Some optimization research can be found in media/doc/memcpy_optimize.txt
*/
.globl _memcpy
_memcpy:
push %ebp
mov %esp,%ebp
push %esi
push %edi
mov 0x8(%ebp),%edi
mov 0xc(%ebp),%esi
mov 0x10(%ebp),%ecx
cld
cmp $16,%ecx
jb .L1
mov %ecx,%edx
test $3,%edi
je .L2
/*
* Make the destination dword aligned
*/
mov %edi,%ecx
and $3,%ecx
sub $5,%ecx
not %ecx
sub %ecx,%edx
rep movsb
mov %edx,%ecx
.L2:
shr $2,%ecx
rep movsl
mov %edx,%ecx
and $3,%ecx
.L1:
test %ecx,%ecx
je .L3
rep movsb
.L3:
pop %edi
pop %esi
mov 0x8(%ebp),%eax
leave
ret

View file

@ -0,0 +1,116 @@
/*
* $Id$
*/
/*
* void *memmove (void *to, const void *from, size_t count)
*/
.globl _memmove
_memmove:
push %ebp
mov %esp,%ebp
push %esi
push %edi
mov 8(%ebp),%edi
mov 12(%ebp),%esi
mov 16(%ebp),%ecx
cmp %esi,%edi
jbe .CopyUp
mov %ecx,%eax
add %esi,%eax
cmp %eax,%edi
jb .CopyDown
.CopyUp:
cld
cmp $16,%ecx
jb .L1
mov %ecx,%edx
test $3,%edi
je .L2
/*
* Make the destination dword aligned
*/
mov %edi,%ecx
and $3,%ecx
sub $5,%ecx
not %ecx
sub %ecx,%edx
rep movsb
mov %edx,%ecx
.L2:
shr $2,%ecx
rep movsl
mov %edx,%ecx
and $3,%ecx
.L1:
test %ecx,%ecx
je .L3
rep movsb
.L3:
mov 8(%ebp),%eax
pop %edi
pop %esi
leave
ret
.CopyDown:
std
add %ecx,%edi
add %ecx,%esi
cmp $16,%ecx
jb .L4
mov %ecx,%edx
test $3,%edi
je .L5
/*
* Make the destination dword aligned
*/
mov %edi,%ecx
and $3,%ecx
sub %ecx,%edx
dec %esi
dec %edi
rep movsb
mov %edx,%ecx
sub $3,%esi
sub $3,%edi
.L6:
shr $2,%ecx
rep movsl
mov %edx,%ecx
and $3,%ecx
je .L7
add $3,%esi
add $3,%edi
.L8:
rep movsb
.L7:
cld
mov 8(%ebp),%eax
pop %edi
pop %esi
leave
ret
.L5:
sub $4,%edi
sub $4,%esi
jmp .L6
.L4:
test %ecx,%ecx
je .L7
dec %esi
dec %edi
jmp .L8

View file

@ -0,0 +1,47 @@
/*
* $Id$
*/
/*
* void *memset (void *src, int val, size_t count)
*/
.globl _memset
_memset:
push %ebp
mov %esp,%ebp
push %edi
mov 0x8(%ebp),%edi
movzb 0xc(%ebp),%eax
mov 0x10(%ebp),%ecx
cld
cmp $16,%ecx
jb .L1
mov $0x01010101,%edx
mul %edx
mov %ecx,%edx
test $3,%edi
je .L2
mov %edi,%ecx
and $3,%ecx
sub $5,%ecx
not %ecx
sub %ecx,%edx
rep stosb
mov %edx,%ecx
.L2:
shr $2,%ecx
rep stosl
mov %edx,%ecx
and $3,%ecx
.L1:
test %ecx,%ecx
je .L3
rep stosb
.L3:
pop %edi
mov 0x8(%ebp),%eax
leave
ret

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcscat.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcschr.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcscmp.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcscpy.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcslen.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcsncat.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcsncmp.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcsncpy.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcsnlen.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include "tcsrchr.h"
/* EOF */

View file

@ -0,0 +1,59 @@
/* $Id$
*/
#ifndef __TCHAR_INC_S__
#define __TCHAR_INC_S__
#ifdef _UNICODE
#define _tcscat _wcscat
#define _tcschr _wcschr
#define _tcscmp _wcscmp
#define _tcscpy _wcscpy
#define _tcslen _wcslen
#define _tcsncat _wcsncat
#define _tcsncmp _wcsncmp
#define _tcsncpy _wcsncpy
#define _tcsnlen _wcsnlen
#define _tcsrchr _wcsrchr
#define _tscas scasw
#define _tlods lodsw
#define _tstos stosw
#define _tsize $2
#define _treg(_O_) _O_ ## x
#define _tdec(_O_) sub $2, _O_
#define _tinc(_O_) add $2, _O_
#else
#define _tcscat _strcat
#define _tcschr _strchr
#define _tcscmp _strcmp
#define _tcscpy _strcpy
#define _tcslen _strlen
#define _tcsncat _strncat
#define _tcsncmp _strncmp
#define _tcsncpy _strncpy
#define _tcsnlen _strnlen
#define _tcsrchr _strrchr
#define _tscas scasb
#define _tlods lodsb
#define _tstos stosb
#define _tsize $1
#define _treg(_O_) _O_ ## l
#define _tdec(_O_) dec _O_
#define _tinc(_O_) inc _O_
#endif
#endif
/* EOF */

View file

@ -0,0 +1,32 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcscat
_tcscat:
push %esi
push %edi
mov 0x0C(%esp), %edi
mov 0x10(%esp), %esi
xor %eax, %eax
mov $-1, %ecx
cld
repne _tscas
_tdec(%edi)
.L1:
_tlods
_tstos
test %_treg(a), %_treg(a)
jnz .L1
mov 0x0C(%esp), %eax
pop %edi
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,30 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcschr
_tcschr:
push %esi
mov 0x8(%esp), %esi
mov 0xC(%esp), %edx
cld
.L1:
_tlods
cmp %_treg(a), %_treg(d)
je .L2
test %_treg(a), %_treg(a)
jnz .L1
mov _tsize, %esi
.L2:
mov %esi, %eax
_tdec(%eax)
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,34 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcscmp
_tcscmp:
push %esi
push %edi
mov 0x0C(%esp), %esi
mov 0x10(%esp), %edi
xor %eax, %eax
cld
.L1:
_tlods
_tscas
jne .L2
test %eax, %eax
jne .L1
xor %eax, %eax
jmp .L3
.L2:
sbb %eax, %eax
or $1, %al
.L3:
pop %edi
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,27 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcscpy
_tcscpy:
push %esi
push %edi
mov 0x0C(%esp), %edi
mov 0x10(%esp), %esi
cld
.L1:
_tlods
_tstos
test %_treg(a), %_treg(a)
jnz .L1
mov 0x0C(%esp), %eax
pop %edi
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,29 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcslen
_tcslen:
push %edi
mov 0x8(%esp), %edi
xor %eax, %eax
test %edi,%edi
jz _tcslen_end
mov $-1, %ecx
cld
repne _tscas
not %ecx
dec %ecx
mov %ecx, %eax
_tcslen_end:
pop %edi
ret
/* EOF */

View file

@ -0,0 +1,42 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcsncat
_tcsncat:
push %esi
push %edi
mov 0x0C(%esp), %edi
mov 0x10(%esp), %esi
cld
xor %eax, %eax
mov $-1, %ecx
repne _tscas
_tdec(%edi)
mov 0x14(%esp),%ecx
.L1:
dec %ecx
js .L2
_tlods
_tstos
test %_treg(a), %_treg(a)
jne .L1
jmp .L3
.L2:
xor %eax, %eax
_tstos
.L3:
mov 0x0C(%esp), %eax
pop %edi
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,40 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcsncmp
_tcsncmp:
push %esi
push %edi
mov 0x0C(%esp), %esi /* s1 */
mov 0x10(%esp), %edi /* s2 */
mov 0x14(%esp), %ecx /* n */
xor %eax,%eax
cld
.L1:
dec %ecx
js .L2
_tlods
_tscas
jne .L3
test %eax, %eax
jne .L1
.L2:
xor %eax, %eax
jmp .L4
.L3:
sbb %eax, %eax
or $1, %al
.L4:
pop %edi
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,34 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcsncpy
_tcsncpy:
push %esi
push %edi
mov 0x0C(%esp), %edi /* s1 */
mov 0x10(%esp), %esi /* s2 */
mov 0x14(%esp), %ecx /* n */
xor %eax, %eax
cld
.L1:
dec %ecx
js .L2
_tlods
_tstos
test %_treg(a), %_treg(a)
jnz .L1
rep _tstos
.L2:
mov 0x0C(%esp), %eax
pop %edi
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,30 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcsnlen
_tcsnlen:
push %edi
mov 0x8(%esp), %edi
mov 0xC(%esp), %ecx
xor %eax, %eax
test %ecx, %ecx
jz .L1
mov %ecx, %edx
cld
repne _tscas
sete %al
sub %ecx, %edx
sub %eax, %edx
mov %edx, %eax
.L1:
pop %edi
ret
/* EOF */

View file

@ -0,0 +1,31 @@
/* $Id$
*/
#include "tchar.h"
.globl _tcsrchr
_tcsrchr:
push %esi
mov 0x8(%esp), %esi
mov 0xC(%esp), %edx
cld
mov _tsize, %ecx
.L1:
_tlods
cmp %_treg(a), %_treg(d)
jne .L2
mov %esi, %ecx
.L2:
test %_treg(a), %_treg(a)
jnz .L1
mov %ecx, %eax
_tdec(%eax)
pop %esi
ret
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcscat.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcschr.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcscmp.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcscpy.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcslen.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcsncat.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcsncmp.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcsncpy.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcsnlen.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#define _UNICODE
#include "tcsrchr.h"
/* EOF */

View file

@ -0,0 +1,18 @@
/*
* $Id$
*/
#include <string.h>
void* memchr(const void *s, int c, size_t n)
{
if (n)
{
const char *p = s;
do {
if (*p++ == c)
return (void *)(p-1);
} while (--n != 0);
}
return 0;
}

View file

@ -0,0 +1,17 @@
/*
* $Id$
*/
#include <string.h>
int memcmp(const void *s1, const void *s2, size_t n)
{
if (n != 0) {
const unsigned char *p1 = s1, *p2 = s2;
do {
if (*p1++ != *p2++)
return (*--p1 - *--p2);
} while (--n != 0);
}
return 0;
}

View file

@ -0,0 +1,16 @@
/*
* $Id$
*/
#include <string.h>
void* memcpy(void* to, const void* from, size_t count)
{
register char *f = (char *)from;
register char *t = (char *)to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
return to;
}

View file

@ -0,0 +1,40 @@
/*
* $Id$
*/
#include <string.h>
void * memmove(void *dest,const void *src,size_t count)
{
char *char_dest = (char *)dest;
char *char_src = (char *)src;
if ((char_dest <= char_src) || (char_dest >= (char_src+count)))
{
/* non-overlapping buffers */
while(count > 0)
{
*char_dest = *char_src;
char_dest++;
char_src++;
count--;
}
}
else
{
/* overlaping buffers */
char_dest = (char *)dest + count - 1;
char_src = (char *)src + count - 1;
while(count > 0)
{
*char_dest = *char_src;
char_dest--;
char_src--;
count--;
}
}
return dest;
}

View file

@ -0,0 +1,17 @@
/*
* $Id$
*/
#include <string.h>
void* memset(void* src, int val, size_t count)
{
char *char_src = (char *)src;
while(count>0) {
*char_src = val;
char_src++;
count--;
}
return src;
}

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcscat.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _XINT int
#include <string.h>
#include "internal/tcschr.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcscmp.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcscpy.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcslen.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcsncat.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcsncmp.h"
/* EOF */

View file

@ -0,0 +1,6 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcsncpy.h"
/* EOF */

View file

@ -0,0 +1,7 @@
/* $Id$
*/
#include <string.h>
#include "internal/tcsnlen.h"
/* EOF */

View file

@ -0,0 +1,54 @@
/*
* $Id$
*/
#include <limits.h>
#include <string.h>
#define BIT_SIZE (CHAR_BIT * sizeof(unsigned long) / sizeof(char))
char* strpbrk(const char *s1, const char *s2)
{
if (*s2 == 0)
{
return 0;
}
if (*(s2+1) == 0)
{
return strchr(s1, *s2);
}
else if (*(s2+2) == 0)
{
char *s3, *s4;
s3 = strchr(s1, *s2);
s4 = strchr(s1, *(s2+1));
if (s3 == 0)
{
return s4;
}
else if (s4 == 0)
{
return s3;
}
return s3 < s4 ? s3 : s4;
}
else
{
unsigned long char_map[(1 << CHAR_BIT) / BIT_SIZE] = {0, };
const unsigned char* str = (const unsigned char*)s1;
while (*s2)
{
char_map[*(const unsigned char*)s2 / BIT_SIZE] |= (1 << (*(const unsigned char*)s2 % BIT_SIZE));
s2++;
}
while (*str)
{
if (char_map[*str / BIT_SIZE] & (1 << (*str % BIT_SIZE)))
{
return (char*)((size_t)str);
}
str++;
}
}
return 0;
}

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _XINT int
#include <string.h>
#include "internal/tcsrchr.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcscat.h"
/* EOF */

View file

@ -0,0 +1,9 @@
/* $Id$
*/
#define _UNICODE
#define _XINT wchar_t
#include <wchar.h>
#include "internal/tcschr.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcscmp.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcscpy.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcslen.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcsncat.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcsncmp.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcsncpy.h"
/* EOF */

View file

@ -0,0 +1,8 @@
/* $Id$
*/
#define _UNICODE
#include <wchar.h>
#include "internal/tcsnlen.h"
/* EOF */

View file

@ -0,0 +1,9 @@
/* $Id$
*/
#define _UNICODE
#define _XINT wchar_t
#include <wchar.h>
#include "internal/tcsrchr.h"
/* EOF */