- Build crt and libcntpr from one source tree (using conditional code and/or different source files where code is not shared).

svn path=/trunk/; revision=30291
This commit is contained in:
Aleksey Bragin
2007-11-09 12:20:16 +00:00
parent 991f9bbaa6
commit 1402877204
143 changed files with 258 additions and 4944 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ If you update a function in the ~/wine directory please send a patch to wine-pat
TODO List:
Implement the remaining functions that are commented out in the .def file
Update source code headers for the license information.
Compleate the W32API conversion for all source files.
Complete the W32API conversion for all source files.
Write a decent regression test suite.
Convert all C++ style comments to C style comments.
????
@@ -1,22 +1,22 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS System Libraries
* FILE: lib/sdk/libcntpr/libcntpr.h
* PURPOSE: NT Private CRT
* PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#ifndef _LIBCNT_
#define _LIBCNT_
//
// C Headers
//
#include <stdlib.h>
#include <stdio.h>
#endif /* _LIBCNT_ */
/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS System Libraries
* FILE: lib/sdk/libcntpr/libcntpr.h
* PURPOSE: NT Private CRT
* PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#ifndef _LIBCNT_
#define _LIBCNT_
//
// C Headers
//
#include <stdlib.h>
#include <stdio.h>
#endif /* _LIBCNT_ */
/* EOF */
@@ -1,162 +1,177 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="libcntpr" type="staticlibrary">
<define name="__NO_CTYPE_INLINES" />
<define name="NO_RTL_INLINES" />
<define name="_NTSYSTEM_" />
<define name="_NTDLLBUILD_" />
<define name="_SEH_NO_NATIVE_NLG" />
<if property="ARCH" value="i386">
<define name="__MINGW_IMPORT">"extern __attribute__ ((dllexport))"</define>
</if>
<include base="libcntpr">.</include>
<directory name="except">
<if property="ARCH" value="i386">
<directory name="i386">
<file>chkstk_asm.s</file>
<file>seh.s</file>
</directory>
</if>
<if property="ARCH" value="powerpc">
<directory name="powerpc">
<file>chkstk_asm.s</file>
<file>seh.s</file>
</directory>
</if>
</directory>
<directory name="math">
<if property="ARCH" value="i386">
<directory name="i386">
<file>alldiv_asm.s</file>
<file>alldvrm_asm.s</file>
<file>allmul_asm.s</file>
<file>allrem_asm.s</file>
<file>allshl_asm.s</file>
<file>allshr_asm.s</file>
<file>atan_asm.s</file>
<file>aulldiv_asm.s</file>
<file>aulldvrm_asm.s</file>
<file>aullrem_asm.s</file>
<file>aullshr_asm.s</file>
<file>ceil_asm.s</file>
<file>cos_asm.s</file>
<file>fabs_asm.s</file>
<file>floor_asm.s</file>
<file>ftol_asm.s</file>
<file>log_asm.s</file>
<file>pow_asm.s</file>
<file>sin_asm.s</file>
<file>sqrt_asm.s</file>
<file>tan_asm.s</file>
</directory>
</if>
<file>abs.c</file>
<file>bsearch.c</file>
<file>labs.c</file>
<file>rand.c</file>
</directory>
<directory name="mem">
<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>
</directory>
</if>
<ifnot property="ARCH" value="i386">
<file>memchr.c</file>
<file>memcpy.c</file>
<file>memmove.c</file>
<file>memset.c</file>
</ifnot>
<file>memccpy.c</file>
<file>memcmp.c</file>
<file>memicmp.c</file>
</directory>
<directory name="string">
<if property="ARCH" value="i386">
<directory name="i386">
<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>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>ctype.c</file>
<file>strcspn.c</file>
<file>stricmp.c</file>
<file>strnicmp.c</file>
<file>strlwr.c</file>
<file>strrev.c</file>
<file>strset.c</file>
<file>strstr.c</file>
<file>strupr.c</file>
<file>strpbrk.c</file>
<file>strspn.c</file>
<file>wstring.c</file>
<file>wcsrev.c</file>
<file>wcsnset.c</file>
<file>atoi64.c</file>
<file>atoi.c</file>
<file>atol.c</file>
<file>itoa.c</file>
<file>itow.c</file>
<file>lfind.c</file>
<file>mbstowcs.c</file>
<file>splitp.c</file>
<file>strtol.c</file>
<file>strtoul.c</file>
<file>strtoull.c</file>
<file>wcstol.c</file>
<file>wcstombs.c</file>
<file>wcstoul.c</file>
<file>wtoi64.c</file>
<file>wtoi.c</file>
<file>wtol.c</file>
<file>sscanf.c</file>
</directory>
<pch>libcntpr.h</pch>
</module>
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="libcntpr" type="staticlibrary">
<include base="crt">.</include>
<include base="crt">include</include>
<define name="__NO_CTYPE_INLINES" />
<define name="NO_RTL_INLINES" />
<define name="_NTSYSTEM_" />
<define name="_NTDLLBUILD_" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="_LIBCNT_" />
<if property="ARCH" value="i386">
<define name="__MINGW_IMPORT">"extern __attribute__ ((dllexport))"</define>
</if>
<directory name="except_nt">
<if property="ARCH" value="i386">
<directory name="i386">
<file>chkstk_asm.s</file>
<file>seh.s</file>
</directory>
</if>
<if property="ARCH" value="powerpc">
<directory name="powerpc">
<file>chkstk_asm.s</file>
<file>seh.s</file>
</directory>
</if>
</directory>
<directory name="math">
<if property="ARCH" value="i386">
<directory name="i386">
<file>alldiv_asm.s</file>
<file>alldvrm_asm.s</file>
<file>allmul_asm.s</file>
<file>allrem_asm.s</file>
<file>allshl_asm.s</file>
<file>allshr_asm.s</file>
<file>atan_asm.s</file>
<file>aulldiv_asm.s</file>
<file>aulldvrm_asm.s</file>
<file>aullrem_asm.s</file>
<file>aullshr_asm.s</file>
<file>ceil_asm.s</file>
<file>cos_asm.s</file>
<file>fabs_asm.s</file>
<file>floor_asm.s</file>
<file>ftol_asm.s</file>
<file>log_asm.s</file>
<file>pow_asm.s</file>
<file>sin_asm.s</file>
<file>sqrt_asm.s</file>
<file>tan_asm.s</file>
</directory>
</if>
<file>abs.c</file>
<file>labs.c</file>
<file>rand_nt.c</file>
</directory>
<directory name="mem">
<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>
</directory>
</if>
<ifnot property="ARCH" value="i386">
<file>memchr.c</file>
<file>memcpy.c</file>
<file>memmove.c</file>
<file>memset.c</file>
</ifnot>
<file>memccpy.c</file>
<file>memcmp.c</file>
<file>memicmp.c</file>
</directory>
<directory name="search">
<file>bsearch.c</file>
<file>lfind.c</file>
</directory>
<directory name="string">
<if property="ARCH" value="i386">
<directory name="i386">
<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>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>ctype.c</file>
<file>strcspn.c</file>
<file>stricmp.c</file>
<file>strnicmp.c</file>
<file>strlwr.c</file>
<file>strrev.c</file>
<file>strset.c</file>
<file>strstr.c</file>
<file>strupr.c</file>
<file>strpbrk.c</file>
<file>strspn.c</file>
<file>atoi64.c</file>
<file>atoi.c</file>
<file>atol.c</file>
<file>itoa.c</file>
<file>itow.c</file>
<file>mbstowcs_nt.c</file>
<file>splitp.c</file>
<file>sscanf.c</file>
<file>strtol.c</file>
<file>strtoul.c</file>
<file>strtoull.c</file>
<file>wcstol.c</file>
<file>wcstombs_nt.c</file>
<file>wcstoul.c</file>
<file>wtoi64.c</file>
<file>wtoi.c</file>
<file>wtol.c</file>
</directory>
<directory name="wstring">
<file>wcsicmp.c</file>
<file>wcslwr.c</file>
<file>wcsnicmp.c</file>
<file>wcsupr.c</file>
<file>wcscspn.c</file>
<file>wcspbrk.c</file>
<file>wcsset.c</file>
<file>wcsspn.c</file>
<file>wcsstr.c</file>
<file>wcsrev.c</file>
</directory>
<pch>precomp.h</pch>
</module>
+36 -8
View File
@@ -1,22 +1,50 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE:
* FILE:
* PROGRAMER: Magnus Olsen (magnus@greatlord.com)
*
* PURPOSE: Run-Time Library
* FILE: lib/rtl/i386/atan.S
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
*
* Copyright (C) 2002 Michael Ringgaard.
* All rights reserved.
*
* 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 project 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
*/
.globl _atan
.intel_syntax noprefix
/* FUNCTIONS ***************************************************************/
_atan:
push ebp
mov ebp,esp
fld qword ptr [ebp+8]
fpatan
mov ebp,esp
fld qword ptr [ebp+8] // Load real from stack
fld1 // Load constant 1
fpatan // Take the arctangent
pop ebp
ret
+1
View File
@@ -1,5 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <precomp.h>
#include <tchar.h>
/*
* @implemented
+1
View File
@@ -1,4 +1,5 @@
#include <precomp.h>
#include <tchar.h>
/*
* @implemented
@@ -1,10 +1,13 @@
/**/
#define WIN32_NO_STATUS
#include <windows.h>
#include <ndk/umtypes.h>
#include <ndk/rtlfuncs.h>
#include <stdlib.h>
#include <stdarg.h>
#include <precomp.h>
#include <wchar.h>
#include <ctype.h>
#define NDEBUG
#include <internal/debug.h>
#define WARN DPRINT1
#define EOF (-1)
@@ -23,7 +26,7 @@ static int char2digit(char c, int base) {
#undef WIDE_SCANF
#undef CONSOLE
#define STRING 1
#include "scanf.h"
#include "wine/scanf.h"
int sscanf(const char *str, const char *format, ...)
{
+8
View File
@@ -460,7 +460,11 @@ _FUNCTION_ {
int invert = 0; /* Set if we are NOT to find the chars */
/* Init our bitmap */
#ifdef _LIBCNT_
Mask = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8);
#else
Mask = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8);
#endif
RtlInitializeBitMap(&bitMask, Mask, _BITMAPSIZE_);
/* Read the format */
@@ -506,7 +510,11 @@ _FUNCTION_ {
}
/* terminate */
if (!suppress) *sptr = 0;
#ifdef _LIBCNT_
RtlFreeHeap(RtlGetProcessHeap(), 0, Mask);
#else
HeapFree(GetProcessHeap(), 0, Mask);
#endif
}
break;
default:
@@ -1,66 +0,0 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Stack checker
* FILE: lib/ntdll/rtl/i386/chkstk.s
* PROGRAMER: KJK::Hyperion <noog@libero.it>
*/
.globl __chkstk
.globl __alloca_probe
/*
_chkstk() is called by all stack allocations of more than 4 KB. It grows the
stack in areas of 4 KB each, trying to access each area. This ensures that the
guard page for the stack is hit, and the stack growing triggered
*/
__chkstk:
__alloca_probe:
/* EAX = size to be allocated */
/* save the ECX register */
pushl %ecx
/* ECX = top of the previous stack frame */
leal 8(%esp), %ecx
/* probe the desired memory, page by page */
cmpl $0x1000, %eax
jge .l_MoreThanAPage
jmp .l_LessThanAPage
.l_MoreThanAPage:
/* raise the top of the stack by a page and probe */
subl $0x1000, %ecx
testl %eax, 0(%ecx)
/* loop if still more than a page must be probed */
subl $0x1000, %eax
cmpl $0x1000, %eax
jge .l_MoreThanAPage
.l_LessThanAPage:
/* raise the top of the stack by EAX bytes (size % 4096) and probe */
subl %eax, %ecx
testl %eax, 0(%ecx)
/* EAX = top of the stack */
movl %esp, %eax
/* allocate the memory */
movl %ecx, %esp
/* restore ECX */
movl 0(%eax), %ecx
/* restore the return address */
movl 4(%eax), %eax
pushl %eax
/* return */
ret
/* EOF */
-468
View File
@@ -1,468 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS CRT
* FILE: lib/crt/misc/i386/seh.S
* PURPOSE: SEH Support for the CRT
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#include <ndk/asm.h>
.intel_syntax noprefix
#define DISPOSITION_DISMISS 0
#define DISPOSITION_CONTINUE_SEARCH 1
#define DISPOSITION_COLLIDED_UNWIND 3
/* GLOBALS *******************************************************************/
.globl __global_unwind2
.globl __local_unwind2
.globl __abnormal_termination
.globl __except_handler2
.globl __except_handler3
/* FUNCTIONS *****************************************************************/
.func unwind_handler
_unwind_handler:
/* Check if we were unwinding and continue search if not */
mov ecx, [esp+4]
test dword ptr [ecx+4], EXCEPTION_EXIT_UNWIND + EXCEPTION_UNWINDING
mov eax, DISPOSITION_CONTINUE_SEARCH
jz unwind_handler_return
/* We have a collision, do a local unwind */
mov eax, [esp+20]
push ebp
mov ebp, [eax+16]
mov edx, [eax+40]
push edx
mov edx, [eax+36]
push edx
call __local_unwind2
add esp, 8
pop ebp
/* Set new try level */
mov eax, [esp+8]
mov edx, [esp+16]
mov [edx], eax
/* Return collided unwind */
mov eax, DISPOSITION_COLLIDED_UNWIND
unwind_handler_return:
ret
.endfunc
.func _global_unwind2
__global_unwind2:
/* Create stack and save all registers */
push ebp
mov ebp, esp
push ebx
push esi
push edi
push ebp
/* Call unwind */
push 0
push 0
push glu_return
push [ebp+8]
call _RtlUnwind@16
glu_return:
/* Restore registers and return */
pop ebp
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
.endfunc
.func _abnormal_termination
__abnormal_termination:
/* Assume false */
xor eax, eax
/* Check if the handler is the unwind handler */
mov ecx, fs:0
cmp dword ptr [ecx+4], offset _unwind_handler
jne short ab_return
/* Get the try level */
mov edx, [ecx+12]
mov edx, [edx+12]
/* Compare it */
cmp [ecx+8], edx
jne ab_return
/* Return true */
mov eax, 1
/* Return */
ab_return:
ret
.endfunc
.func _local_unwind2
__local_unwind2:
/* Save volatiles */
push ebx
push esi
push edi
/* Get the exception registration */
mov eax, [esp+16]
/* Setup SEH to protect the unwind */
push ebp
push eax
push -2
push offset _unwind_handler
push fs:0
mov fs:0, esp
unwind_loop:
/* Get the exception registration and try level */
mov eax, [esp+36]
mov ebx, [eax+8]
mov esi, [eax+12]
/* Validate the unwind */
cmp esi, -1
je unwind_return
cmp dword ptr [esp+40], -1
je unwind_ok
cmp esi, [esp+40]
jbe unwind_return
unwind_ok:
/* Get the new enclosing level and save it */
lea esi, [esi+esi*2]
mov ecx, [ebx+esi*4]
mov [esp+8], ecx
mov [eax+12], ecx
/* Check the filter type */
cmp dword ptr [ebx+esi*4+4], 0
jnz __NLG_Return2
/* FIXME: NLG Notification */
/* Call the handler */
call dword ptr [ebx+esi*4+8]
__NLG_Return2:
/* Unwind again */
jmp unwind_loop
unwind_return:
/* Cleanup SEH */
pop fs:0
add esp, 16
pop edi
pop esi
pop ebx
ret
.endfunc
.func _except_handler2
__except_handler2:
/* Setup stack and save volatiles */
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push edi
push ebp
/* Clear direction flag */
cld
/* Get exception registration and record */
mov ebx, [ebp+12]
mov eax, [ebp+8]
/* Check if this is an unwind */
test dword ptr [eax+4], EXCEPTION_EXIT_UNWIND + EXCEPTION_UNWINDING
jnz except_unwind2
/* Save exception pointers structure */
mov [ebp-8], eax
mov eax, [ebp+16]
mov [ebp-4], eax
lea eax, [ebp-8]
mov [ebx+20], eax
/* Get the try level and scope table */
mov esi, [ebx+12]
mov esi, [ebx+8]
except_loop2:
/* Validate try level */
cmp esi, -1
je except_search2
/* Check if this is the termination handler */
lea ecx, [esi+esi*2]
cmp dword ptr [edi+ecx*4+4], 0
jz except_continue2
/* Save registers and call filter, then restore them */
push esi
push ebp
mov ebp, [ebx+16]
call dword ptr [edi+ecx*4+4]
pop ebp
pop esi
/* Restore ebx and check the result */
mov ebx, [ebp+12]
or eax, eax
jz except_continue2
jz except_dismiss2
/* So this is an accept, call the termination handlers */
mov edi, [ebx+8]
push ebx
call __global_unwind2
add esp, 4
/* Restore ebp */
mov ebp, [ebx+16]
/* Do local unwind */
push esi
push ebx
call __local_unwind2
add esp, 8
/* Set new try level */
lea ecx, [esi+esi*2]
mov eax, [edi+ecx*4]
mov [ebx+12], eax
/* Call except handler */
call [edi+ecx*4+8]
except_continue2:
/* Reload try level and except again */
mov edi, [ebx+8]
lea ecx, [esi+esi*2]
mov esi, [edi+ecx*4]
jmp except_loop2
except_dismiss2:
/* Dismiss it */
mov eax, DISPOSITION_DISMISS
jmp except_return2
except_search2:
/* Continue searching */
mov eax, DISPOSITION_CONTINUE_SEARCH
jmp except_return2
/* Do local unwind */
except_unwind2:
push ebp
mov ebp, [ebx+16]
push -1
push ebx
call __local_unwind2
add esp, 8
/* Retore EBP and set return disposition */
pop ebp
mov eax, DISPOSITION_CONTINUE_SEARCH
except_return2:
/* Restore registers and stack */
pop ebp
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
.endfunc
.func _except_handler3
__except_handler3:
/* Setup stack and save volatiles */
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push edi
push ebp
/* Clear direction flag */
cld
/* Get exception registration and record */
mov ebx, [ebp+12]
mov eax, [ebp+8]
/* Check if this is an unwind */
test dword ptr [eax+4], EXCEPTION_EXIT_UNWIND + EXCEPTION_UNWINDING
jnz except_unwind3
/* Save exception pointers structure */
mov [ebp-8], eax
mov eax, [ebp+16]
mov [ebp-4], eax
lea eax, [ebp-8]
mov [ebx-4], eax
/* Get the try level and scope table */
mov esi, [ebx+12]
mov esi, [ebx+8]
/* FIXME: Validate the SEH exception */
except_loop3:
/* Validate try level */
cmp esi, -1
je except_search3
/* Check if this is the termination handler */
lea ecx, [esi+esi*2]
mov eax, [edi+ecx*4+4]
or eax, eax
jz except_continue3
/* Save registers clear them all */
push esi
push ebp
lea ebp, [ebx+16]
xor ebx, ebx
xor ecx, ecx
xor edx, edx
xor esi, esi
xor edi, edi
/* Call the filter and restore our registers */
call eax
pop ebp
pop esi
/* Restore ebx and check the result */
mov ebx, [ebp+12]
or eax, eax
jz except_continue3
jz except_dismiss3
/* So this is an accept, call the termination handlers */
mov edi, [ebx+8]
push ebx
call __global_unwind2
add esp, 4
/* Restore ebp */
lea ebp, [ebx+16]
/* Do local unwind */
push esi
push ebx
call __local_unwind2
add esp, 8
/* FIXME: Do NLG Notification */
/* Set new try level */
lea ecx, [esi+esi*2]
mov eax, [edi+ecx*4]
mov [ebx+12], eax
/* Clear registers and call except handler */
mov eax, [edi+ecx*4+8]
xor ebx, ebx
xor ecx, ecx
xor edx, edx
xor esi, esi
xor edi, edi
call eax
except_continue3:
/* Reload try level and except again */
mov edi, [ebx+8]
lea ecx, [esi+esi*2]
mov esi, [edi+ecx*4]
jmp except_loop3
except_dismiss3:
/* Dismiss it */
mov eax, DISPOSITION_DISMISS
jmp except_return3
except_search3:
/* Continue searching */
mov eax, DISPOSITION_CONTINUE_SEARCH
jmp except_return3
/* Do local unwind */
except_unwind3:
push ebp
mov ebp, [ebx+16]
push -1
push ebx
call __local_unwind2
add esp, 8
/* Retore EBP and set return disposition */
pop ebp
mov eax, DISPOSITION_CONTINUE_SEARCH
except_return3:
/* Restore registers and stack */
pop ebp
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
.endfunc
//
//
// REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME
//
//
.func RtlpGetStackLimits@8
.globl _RtlpGetStackLimits@8
_RtlpGetStackLimits@8:
/* Get the current thread */
mov eax, [fs:KPCR_CURRENT_THREAD]
/* Get the stack limits */
mov ecx, [eax+KTHREAD_STACK_LIMIT]
mov edx, [eax+KTHREAD_INITIAL_STACK]
sub edx, SIZEOF_FX_SAVE_AREA
/* Return them */
mov eax, [esp+4]
mov [eax], ecx
mov eax, [esp+8]
mov [eax], edx
/* return */
ret 8
.endfunc
@@ -1,23 +0,0 @@
/* $Id: chkstk_asm.s 26099 2007-03-14 20:30:32Z ion $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Stack checker
* FILE: lib/ntdll/rtl/i386/chkstk.s
* PROGRAMER: arty
*/
.globl _chkstk
.globl _alloca_probe
/*
_chkstk() is called by all stack allocations of more than 4 KB. It grows the
stack in areas of 4 KB each, trying to access each area. This ensures that the
guard page for the stack is hit, and the stack growing triggered
*/
_chkstk:
_alloca_probe:
/* return */
blr
/* EOF */
@@ -1,75 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS CRT
* FILE: lib/crt/misc/i386/seh.S
* PURPOSE: SEH Support for the CRT
* PROGRAMMERS: arty
*/
/* INCLUDES ******************************************************************/
#include <ndk/asm.h>
#define DISPOSITION_DISMISS 0
#define DISPOSITION_CONTINUE_SEARCH 1
#define DISPOSITION_COLLIDED_UNWIND 3
/* GLOBALS *******************************************************************/
.globl _global_unwind2
.globl _local_unwind2
.globl _abnormal_termination
.globl _except_handler2
.globl _except_handler3
/* FUNCTIONS *****************************************************************/
unwind_handler:
blr
_global_unwind2:
blr
_local_unwind2:
blr
_except_handler2:
blr
_except_handler3:
blr
//
//
// REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME
// sorry
//
//
.globl RtlpGetStackLimits
RtlpGetStackLimits:
stwu 1,16(1)
mflr 0
stw 0,4(1)
stw 3,8(1)
stw 4,12(1)
/* Get the current thread */
lwz 3,KPCR_CURRENT_THREAD(13)
/* Get the stack limits */
lwz 4,KTHREAD_STACK_LIMIT(3)
lwz 5,KTHREAD_INITIAL_STACK(3)
subi 5,5,SIZEOF_FX_SAVE_AREA
/* Return them */
lwz 3,8(1)
stw 4,0(3)
lwz 3,12(1)
stw 5,0(3)
addi 1,1,16
/* return */
blr
-10
View File
@@ -1,10 +0,0 @@
#include <string.h>
/*
* @implemented
*/
int
abs(int j)
{
return j<0 ? -j : j;
}
-27
View File
@@ -1,27 +0,0 @@
#include <string.h>
/*
* @implemented
*/
void *
bsearch(const void *key, const void *base0, size_t nelem,
size_t size, int (*cmp)(const void *ck, const void *ce))
{
const char *base = base0;
int lim, cmpval;
const void *p;
for (lim = nelem; lim != 0; lim >>= 1)
{
p = base + (lim >> 1) * size;
cmpval = (*cmp)(key, p);
if (cmpval == 0)
return (void*)((size_t)p);
if (cmpval > 0)
{ /* key > p: move right */
base = (const char *)p + size;
lim--;
} /* else move left */
}
return 0;
}
@@ -1,50 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Run-Time Library
* FILE: lib/rtl/i386/atan.S
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
*
* Copyright (C) 2002 Michael Ringgaard.
* All rights reserved.
*
* 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 project 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
*/
.globl _atan
.intel_syntax noprefix
/* FUNCTIONS ***************************************************************/
_atan:
push ebp
mov ebp,esp
fld qword ptr [ebp+8] // Load real from stack
fld1 // Load constant 1
fpatan // Take the arctangent
pop ebp
ret
@@ -1,139 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Run-Time Library
* FILE: lib/rtl/i386/pow.S
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
*
* Copyright (C) 2002 Michael Ringgaard.
* All rights reserved.
*
* 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 project 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
*/
.globl _pow
/* DATA ********************************************************************/
fzero:
.long 0 // Floating point zero
.long 0 // Floating point zero
.intel_syntax noprefix
/* FUNCTIONS ***************************************************************/
_pow:
push ebp
mov ebp,esp
sub esp,12 // Allocate temporary space
push edi // Save register edi
push eax // Save register eax
mov dword ptr [ebp-12],0 // Set negation flag to zero
fld qword ptr [ebp+16] // Load real from stack
fld qword ptr [ebp+8] // Load real from stack
mov edi,offset flat:fzero // Point to real zero
fcom qword ptr [edi] // Compare x with zero
fstsw ax // Get the FPU status word
mov al,ah // Move condition flags to AL
lahf // Load Flags into AH
and al, 0b01000101 // Isolate C0, C2 and C3
and ah, 0b10111010 // Turn off CF, PF and ZF
or ah,al // Set new CF, PF and ZF
sahf // Store AH into Flags
jb __fpow1 // Re-direct if x < 0
ja __fpow3 // Re-direct if x > 0
fxch // Swap st, st(1)
fcom qword ptr [edi] // Compare y with zero
fxch // Restore x as top of stack
fstsw ax // Get the FPU status word
mov al,ah // Move condition flags to AL
lahf // Load Flags into AH
and al, 0b01000101 // Isolate C0, C2 and C3
and ah, 0b10111010 // Turn off CF, PF and ZF
or ah,al // Set new CF, PF and ZF
sahf // Store AH into Flags
ja __fpow3 // Re-direct if y > 0
fstp st(1) // Set new stack top and pop
mov eax,1 // Set domain error (EDOM)
jmp __fpow5 // End of case
__fpow1: fxch // Put y on top of stack
fld st // Duplicate y as st(1)
frndint // Round to integer
fxch // Put y on top of stack
fcomp // y = int(y) ?
fstsw ax // Get the FPU status word
mov al,ah // Move condition flags to AL
lahf // Load Flags into AH
and al, 0b01000101 // Isolate C0, C2 and C3
and ah, 0b10111010 // Turn off CF, PF and ZF
or ah,al // Set new CF, PF and ZF
sahf // Store AH into Flags
je __fpow2 // Proceed if y = int(y)
fstp st(1) // Set new stack top and pop
fldz // Set result to zero
fstp st(1) // Set new stack top and pop
mov eax,1 // Set domain error (EDOM)
jmp __fpow5 // End of case
__fpow2: fist dword ptr [ebp-12] // Store y as integer
and dword ptr [ebp-12],1 // Set bit if y is odd
fxch // Put x on top of stack
fabs // x = |x|
__fpow3: fldln2 // Load log base e of 2
fxch st(1) // Exchange st, st(1)
fyl2x // Compute the natural log(x)
fmulp // Compute y * ln(x)
fldl2e // Load log base 2(e)
fmulp st(1),st // Multiply x * log base 2(e)
fst st(1) // Push result
frndint // Round to integer
fsub st(1),st // Subtract
fxch // Exchange st, st(1)
f2xm1 // Compute 2 to the (x - 1)
fld1 // Load real number 1
faddp // 2 to the x
fscale // Scale by power of 2
fstp st(1) // Set new stack top and pop
test dword ptr [ebp-12],1 // Negation required ?
jz __fpow4 // No, re-direct
fchs // Negate the result
__fpow4: fstp qword ptr [ebp-8] // Save (double)pow(x, y)
fld qword ptr [ebp-8] // Load (double)pow(x, y)
fxam // Examine st
fstsw ax // Get the FPU status word
cmp ah,5 // Infinity ?
jne __fpow6 // No, end of case
mov eax,2 // Set range error (ERANGE)
// Get errno pointer offset
__fpow5: int 3
mov edi,0 // TODO: offset flat:__crt_errno
mov edi,[edi] // Get C errno variable pointer
mov dword ptr [edi],eax // Set errno
__fpow6: pop eax // Restore register eax
pop edi // Restore register edi
mov esp,ebp // Deallocate temporary space
pop ebp
ret
-9
View File
@@ -1,9 +0,0 @@
#include <string.h>
/*
* @implemented
*/
long
labs(long j)
{
return j<0 ? -j : j;
}
@@ -1,31 +0,0 @@
/* $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
@@ -1,48 +0,0 @@
/*
* 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
@@ -1,116 +0,0 @@
/*
* $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
@@ -1,47 +0,0 @@
/*
* $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
-25
View File
@@ -1,25 +0,0 @@
/*
* $Id$
*/
#include <string.h>
void *
_memccpy (void *to, const void *from,int c,size_t count)
{
char t;
size_t i;
char *dst=(char*)to;
const char *src=(const char*)from;
for ( i = 0; i < count; i++ )
{
dst[i] = t = src[i];
if ( t == '\0' )
break;
if ( t == c )
return &dst[i+1];
}
return NULL; /* didn't copy c */
}
-18
View File
@@ -1,18 +0,0 @@
/*
* $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;
}
-17
View File
@@ -1,17 +0,0 @@
/*
* $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;
}
-16
View File
@@ -1,16 +0,0 @@
/*
* $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;
}
-22
View File
@@ -1,22 +0,0 @@
#include <string.h>
#include <ctype.h>
/*
* @implemented
*/
int
_memicmp(const void *s1, const void *s2, size_t n)
{
if (n != 0)
{
const unsigned char *p1 = s1, *p2 = s2;
do {
if (toupper(*p1) != toupper(*p2))
return (*p1 - *p2);
p1++;
p2++;
} while (--n != 0);
}
return 0;
}
-40
View File
@@ -1,40 +0,0 @@
/*
* $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;
}
-17
View File
@@ -1,17 +0,0 @@
/*
* $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;
}
-11
View File
@@ -1,11 +0,0 @@
#include <string.h>
#include <stdlib.h>
/*
* @implemented
*/
int
atoi(const char *str)
{
return (int)strtol(str, 0, 10);
}
-37
View File
@@ -1,37 +0,0 @@
#include <string.h>
#include <ctype.h>
#include <basetsd.h>
/*
* @implemented
*/
__int64
_atoi64 (const char *nptr)
{
int c;
__int64 value;
int sign;
while (isspace((int)*nptr))
++nptr;
c = (int)*nptr++;
sign = c;
if (c == '-' || c == '+')
c = (int)*nptr++;
value = 0;
while (isdigit(c))
{
value = 10 * value + (c - '0');
c = (int)*nptr++;
}
if (sign == '-')
return -value;
else
return value;
}
/* EOF */
-11
View File
@@ -1,11 +0,0 @@
#include <string.h>
#include <stdlib.h>
/*
* @implemented
*/
long
atol(const char *str)
{
return strtol(str, 0, 10);
}
-591
View File
@@ -1,591 +0,0 @@
#include <string.h>
#include <ctype.h>
#undef _pctype
#define upalpha ('A' - 'a')
unsigned short _ctype[] = {
0, /* <EOF>, 0xFFFF */
_CONTROL, /* CTRL+@, 0x00 */
_CONTROL, /* CTRL+A, 0x01 */
_CONTROL, /* CTRL+B, 0x02 */
_CONTROL, /* CTRL+C, 0x03 */
_CONTROL, /* CTRL+D, 0x04 */
_CONTROL, /* CTRL+E, 0x05 */
_CONTROL, /* CTRL+F, 0x06 */
_CONTROL, /* CTRL+G, 0x07 */
_CONTROL, /* CTRL+H, 0x08 */
_CONTROL | _SPACE, /* CTRL+I, 0x09 */
_CONTROL | _SPACE, /* CTRL+J, 0x0a */
_CONTROL | _SPACE, /* CTRL+K, 0x0b */
_CONTROL | _SPACE, /* CTRL+L, 0x0c */
_CONTROL | _SPACE, /* CTRL+M, 0x0d */
_CONTROL, /* CTRL+N, 0x0e */
_CONTROL, /* CTRL+O, 0x0f */
_CONTROL, /* CTRL+P, 0x10 */
_CONTROL, /* CTRL+Q, 0x11 */
_CONTROL, /* CTRL+R, 0x12 */
_CONTROL, /* CTRL+S, 0x13 */
_CONTROL, /* CTRL+T, 0x14 */
_CONTROL, /* CTRL+U, 0x15 */
_CONTROL, /* CTRL+V, 0x16 */
_CONTROL, /* CTRL+W, 0x17 */
_CONTROL, /* CTRL+X, 0x18 */
_CONTROL, /* CTRL+Y, 0x19 */
_CONTROL, /* CTRL+Z, 0x1a */
_CONTROL, /* CTRL+[, 0x1b */
_CONTROL, /* CTRL+\, 0x1c */
_CONTROL, /* CTRL+], 0x1d */
_CONTROL, /* CTRL+^, 0x1e */
_CONTROL, /* CTRL+_, 0x1f */
_SPACE | _BLANK, /* ` ', 0x20 */
_PUNCT, /* `!', 0x21 */
_PUNCT, /* 0x22 */
_PUNCT, /* `#', 0x23 */
_PUNCT, /* `$', 0x24 */
_PUNCT, /* `%', 0x25 */
_PUNCT, /* `&', 0x26 */
_PUNCT, /* 0x27 */
_PUNCT, /* `(', 0x28 */
_PUNCT, /* `)', 0x29 */
_PUNCT, /* `*', 0x2a */
_PUNCT, /* `+', 0x2b */
_PUNCT, /* `,', 0x2c */
_PUNCT, /* `-', 0x2d */
_PUNCT, /* `.', 0x2e */
_PUNCT, /* `/', 0x2f */
_DIGIT | _HEX, /* `0', 0x30 */
_DIGIT | _HEX, /* `1', 0x31 */
_DIGIT | _HEX, /* `2', 0x32 */
_DIGIT | _HEX, /* `3', 0x33 */
_DIGIT | _HEX, /* `4', 0x34 */
_DIGIT | _HEX, /* `5', 0x35 */
_DIGIT | _HEX, /* `6', 0x36 */
_DIGIT | _HEX, /* `7', 0x37 */
_DIGIT | _HEX, /* `8', 0x38 */
_DIGIT | _HEX, /* `9', 0x39 */
_PUNCT, /* `:', 0x3a */
_PUNCT, /* `;', 0x3b */
_PUNCT, /* `<', 0x3c */
_PUNCT, /* `=', 0x3d */
_PUNCT, /* `>', 0x3e */
_PUNCT, /* `?', 0x3f */
_PUNCT, /* `@', 0x40 */
_UPPER | _HEX, /* `A', 0x41 */
_UPPER | _HEX, /* `B', 0x42 */
_UPPER | _HEX, /* `C', 0x43 */
_UPPER | _HEX, /* `D', 0x44 */
_UPPER | _HEX, /* `E', 0x45 */
_UPPER | _HEX, /* `F', 0x46 */
_UPPER, /* `G', 0x47 */
_UPPER, /* `H', 0x48 */
_UPPER, /* `I', 0x49 */
_UPPER, /* `J', 0x4a */
_UPPER, /* `K', 0x4b */
_UPPER, /* `L', 0x4c */
_UPPER, /* `M', 0x4d */
_UPPER, /* `N', 0x4e */
_UPPER, /* `O', 0x4f */
_UPPER, /* `P', 0x50 */
_UPPER, /* `Q', 0x51 */
_UPPER, /* `R', 0x52 */
_UPPER, /* `S', 0x53 */
_UPPER, /* `T', 0x54 */
_UPPER, /* `U', 0x55 */
_UPPER, /* `V', 0x56 */
_UPPER, /* `W', 0x57 */
_UPPER, /* `X', 0x58 */
_UPPER, /* `Y', 0x59 */
_UPPER, /* `Z', 0x5a */
_PUNCT, /* `[', 0x5b */
_PUNCT, /* 0x5c */
_PUNCT, /* `]', 0x5d */
_PUNCT, /* `^', 0x5e */
_PUNCT, /* `_', 0x5f */
_PUNCT, /* 0x60 */
_LOWER | _HEX, /* `a', 0x61 */
_LOWER | _HEX, /* `b', 0x62 */
_LOWER | _HEX, /* `c', 0x63 */
_LOWER | _HEX, /* `d', 0x64 */
_LOWER | _HEX, /* `e', 0x65 */
_LOWER | _HEX, /* `f', 0x66 */
_LOWER, /* `g', 0x67 */
_LOWER, /* `h', 0x68 */
_LOWER, /* `i', 0x69 */
_LOWER, /* `j', 0x6a */
_LOWER, /* `k', 0x6b */
_LOWER, /* `l', 0x6c */
_LOWER, /* `m', 0x6d */
_LOWER, /* `n', 0x6e */
_LOWER, /* `o', 0x6f */
_LOWER, /* `p', 0x70 */
_LOWER, /* `q', 0x71 */
_LOWER, /* `r', 0x72 */
_LOWER, /* `s', 0x73 */
_LOWER, /* `t', 0x74 */
_LOWER, /* `u', 0x75 */
_LOWER, /* `v', 0x76 */
_LOWER, /* `w', 0x77 */
_LOWER, /* `x', 0x78 */
_LOWER, /* `y', 0x79 */
_LOWER, /* `z', 0x7a */
_PUNCT, /* `{', 0x7b */
_PUNCT, /* `|', 0x7c */
_PUNCT, /* `}', 0x7d */
_PUNCT, /* `~', 0x7e */
_CONTROL, /* 0x7f */
0, /* 0x80 */
0, /* 0x81 */
0, /* 0x82 */
0, /* 0x83 */
0, /* 0x84 */
0, /* 0x85 */
0, /* 0x86 */
0, /* 0x87 */
0, /* 0x88 */
0, /* 0x89 */
0, /* 0x8a */
0, /* 0x8b */
0, /* 0x8c */
0, /* 0x8d */
0, /* 0x8e */
0, /* 0x8f */
0, /* 0x90 */
0, /* 0x91 */
0, /* 0x92 */
0, /* 0x93 */
0, /* 0x94 */
0, /* 0x95 */
0, /* 0x96 */
0, /* 0x97 */
0, /* 0x98 */
0, /* 0x99 */
0, /* 0x9a */
0, /* 0x9b */
0, /* 0x9c */
0, /* 0x9d */
0, /* 0x9e */
0, /* 0x9f */
0, /* 0xa0 */
0, /* 0xa1 */
0, /* 0xa2 */
0, /* 0xa3 */
0, /* 0xa4 */
0, /* 0xa5 */
0, /* 0xa6 */
0, /* 0xa7 */
0, /* 0xa8 */
0, /* 0xa9 */
0, /* 0xaa */
0, /* 0xab */
0, /* 0xac */
0, /* 0xad */
0, /* 0xae */
0, /* 0xaf */
0, /* 0xb0 */
0, /* 0xb1 */
0, /* 0xb2 */
0, /* 0xb3 */
0, /* 0xb4 */
0, /* 0xb5 */
0, /* 0xb6 */
0, /* 0xb7 */
0, /* 0xb8 */
0, /* 0xb9 */
0, /* 0xba */
0, /* 0xbb */
0, /* 0xbc */
0, /* 0xbd */
0, /* 0xbe */
0, /* 0xbf */
0, /* 0xc0 */
0, /* 0xc1 */
0, /* 0xc2 */
0, /* 0xc3 */
0, /* 0xc4 */
0, /* 0xc5 */
0, /* 0xc6 */
0, /* 0xc7 */
0, /* 0xc8 */
0, /* 0xc9 */
0, /* 0xca */
0, /* 0xcb */
0, /* 0xcc */
0, /* 0xcd */
0, /* 0xce */
0, /* 0xcf */
0, /* 0xd0 */
0, /* 0xd1 */
0, /* 0xd2 */
0, /* 0xd3 */
0, /* 0xd4 */
0, /* 0xd5 */
0, /* 0xd6 */
0, /* 0xd7 */
0, /* 0xd8 */
0, /* 0xd9 */
0, /* 0xda */
0, /* 0xdb */
0, /* 0xdc */
0, /* 0xdd */
0, /* 0xde */
0, /* 0xdf */
0, /* 0xe0 */
0, /* 0xe1 */
0, /* 0xe2 */
0, /* 0xe3 */
0, /* 0xe4 */
0, /* 0xe5 */
0, /* 0xe6 */
0, /* 0xe7 */
0, /* 0xe8 */
0, /* 0xe9 */
0, /* 0xea */
0, /* 0xeb */
0, /* 0xec */
0, /* 0xed */
0, /* 0xee */
0, /* 0xef */
0, /* 0xf0 */
0, /* 0xf1 */
0, /* 0xf2 */
0, /* 0xf3 */
0, /* 0xf4 */
0, /* 0xf5 */
0, /* 0xf6 */
0, /* 0xf7 */
0, /* 0xf8 */
0, /* 0xf9 */
0, /* 0xfa */
0, /* 0xfb */
0, /* 0xfc */
0, /* 0xfd */
0, /* 0xfe */
0 /* 0xff */
};
unsigned short *_pctype = _ctype + 1;
unsigned short *_pwctype = _ctype + 1;
/*
* @implemented
*/
unsigned short **__p__pctype(void)
{
return &_pctype;
}
/*
* @implemented
*/
unsigned short **__p__pwctype(void)
{
return &_pwctype;
}
int _isctype (int c, int ctypeFlags)
{
return (_pctype[(unsigned char)(c & 0xFF)] & ctypeFlags);
}
/*
* @implemented
*/
int iswctype(wint_t wc, wctype_t wctypeFlags)
{
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
}
/*
* obsolete
*
* @implemented
*/
int is_wctype(wint_t wc, wctype_t wctypeFlags)
{
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
}
/*
* @implemented
*/
int isalpha(int c)
{
return(_isctype(c, _ALPHA));
}
/*
* @implemented
*/
int isalnum(int c)
{
return(_isctype(c, _ALPHA | _DIGIT));
}
/*
* @implemented
*/
int iswalnum(wint_t c)
{
return iswctype(c, _ALPHA | _DIGIT);
}
/*
* @implemented
*/
int __isascii(int c)
{
return ((unsigned char)c <= 0x7f);
}
/*
* @implemented
*/
int iswascii(wint_t c)
{
return __isascii(c);
}
/*
* @implemented
*/
int iscntrl(int c)
{
return(_isctype(c, _CONTROL));
}
/*
* @implemented
*/
int __iscsym(int c)
{
return(isalnum(c)||(c == '_'));
}
/*
* @implemented
*/
int __iscsymf(int c)
{
return(isalpha(c)||(c == '_'));
}
/*
* @implemented
*/
int isdigit(int c)
{
return(_isctype(c, _DIGIT));
}
/*
* @implemented
*/
int isgraph(int c)
{
return (_isctype (c, _PUNCT | _ALPHA | _DIGIT));
}
/*
* @implemented
*/
int islower(int c)
{
return (_isctype (c, _LOWER));
}
/*
* @implemented
*/
int isprint(int c)
{
return (_isctype (c, _BLANK | _PUNCT | _ALPHA | _DIGIT));
}
/*
* @implemented
*/
int ispunct(int c)
{
return (_isctype (c, _PUNCT));
}
/*
* @implemented
*/
int isspace(int c)
{
return (_isctype (c, _SPACE));
}
/*
* @implemented
*/
int isupper(int c)
{
return (_isctype (c, _UPPER));
}
/*
* @implemented
*/
int isxdigit(int c)
{
return (_isctype (c, _HEX));
}
/*
* @implemented
*/
int iswalpha(wint_t c)
{
return (iswctype (c, _ALPHA));
}
/*
* @implemented
*/
int iswcntrl(wint_t c)
{
return iswctype(c, _CONTROL);
}
/*
* @implemented
*/
int iswdigit(wint_t c)
{
return (iswctype (c, _DIGIT));
}
/*
* @implemented
*/
int iswgraph(wint_t c)
{
return iswctype(c,_PUNCT | _ALPHA | _DIGIT);
}
/*
* @implemented
*/
int iswprint(wint_t c)
{
return iswctype((unsigned short)c,_BLANK | _PUNCT | _ALPHA | _DIGIT);
}
/*
* @implemented
*/
int iswpunct(wint_t c)
{
return iswctype(c, _PUNCT);
}
/*
* @implemented
*/
int iswlower(wint_t c)
{
return (iswctype (c, _LOWER));
}
/*
* @implemented
*/
int iswupper(wint_t c)
{
return iswctype(c, _UPPER);
}
/*
* @implemented
*/
int iswspace(wint_t c)
{
return (iswctype (c, _SPACE));
}
/*
* @implemented
*/
int iswxdigit(wint_t c)
{
return (iswctype (c, _HEX));
}
/*
* @implemented
*/
int __toascii(int c)
{
return((unsigned)(c) & 0x7f);
}
/*
* @implemented
*/
int _tolower(int c)
{
if (_isctype (c, _UPPER))
return (c - upalpha);
return(c);
}
/*
* @implemented
*/
int _toupper(int c)
{
if (_isctype (c, _LOWER))
return (c + upalpha);
return(c);
}
/*
* @implemented
*/
int tolower(int c)
{
if (_isctype (c, _UPPER))
return (c - upalpha);
return(c);
}
/*
* @implemented
*/
int toupper(int c)
{
if (_isctype (c, _LOWER))
return (c + upalpha);
return(c);
}
/*
* @implemented
*/
wint_t towlower(wint_t c)
{
if (iswctype (c, _UPPER))
return (c - upalpha);
return(c);
}
/*
* @implemented
*/
wint_t towupper(wint_t c)
{
if (iswctype (c, _LOWER))
return (c + upalpha);
return(c);
}
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcscat.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcschr.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcscmp.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcscpy.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcslen.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcsncat.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcsncmp.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcsncpy.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcsnlen.h"
/* EOF */
@@ -1,6 +0,0 @@
/* $Id$
*/
#include "tcsrchr.h"
/* EOF */
@@ -1,59 +0,0 @@
/* $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 */
@@ -1,32 +0,0 @@
/* $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 */
@@ -1,30 +0,0 @@
/* $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 */
@@ -1,34 +0,0 @@
/* $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 */
@@ -1,27 +0,0 @@
/* $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 */
@@ -1,29 +0,0 @@
/* $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 */
@@ -1,42 +0,0 @@
/* $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 */
@@ -1,40 +0,0 @@
/* $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 */
@@ -1,34 +0,0 @@
/* $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 */
@@ -1,30 +0,0 @@
/* $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 */
@@ -1,31 +0,0 @@
/* $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 */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcscat.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcschr.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcscmp.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcscpy.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcslen.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcsncat.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcsncmp.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcsncpy.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcsnlen.h"
/* EOF */
@@ -1,7 +0,0 @@
/* $Id$
*/
#define _UNICODE
#include "tcsrchr.h"
/* EOF */
-161
View File
@@ -1,161 +0,0 @@
#include <string.h>
#include <stdlib.h>
#include <windows.h>
/*
* @implemented
* copy _i64toa from wine cvs 2006 month 05 day 21
*/
char *
_i64toa(__int64 value, char *string, int radix)
{
ULONGLONG val;
int negative;
char buffer[65];
char *pos;
int digit;
if (value < 0 && radix == 10) {
negative = 1;
val = -value;
} else {
negative = 0;
val = value;
} /* if */
pos = &buffer[64];
*pos = '\0';
do {
digit = val % radix;
val = val / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (val != 0L);
if (negative) {
*--pos = '-';
} /* if */
memcpy(string, pos, &buffer[64] - pos + 1);
return string;
}
/*
* @implemented
* copy _i64toa from wine cvs 2006 month 05 day 21
*/
char *
_ui64toa(unsigned __int64 value, char *string, int radix)
{
char buffer[65];
char *pos;
int digit;
pos = &buffer[64];
*pos = '\0';
do {
digit = value % radix;
value = value / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (value != 0L);
memcpy(string, pos, &buffer[64] - pos + 1);
return string;
}
/*
* @implemented
*/
char *
_itoa(int value, char *string, int radix)
{
return _ltoa(value, string, radix);
}
/*
* @implemented
*/
char *
_ltoa(long value, char *string, int radix)
{
unsigned long val;
int negative;
char buffer[33];
char *pos;
int digit;
if (value < 0 && radix == 10) {
negative = 1;
val = -value;
} else {
negative = 0;
val = value;
} /* if */
pos = &buffer[32];
*pos = '\0';
do {
digit = val % radix;
val = val / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (val != 0L);
if (negative) {
*--pos = '-';
} /* if */
memcpy(string, pos, &buffer[32] - pos + 1);
return string;
}
/*
* @implemented
* copy it from wine 0.9.0 with small modifcations do check for NULL
*/
char *
_ultoa(unsigned long value, char *string, int radix)
{
char buffer[33];
char *pos;
int digit;
pos = &buffer[32];
*pos = '\0';
if (string == NULL)
{
return NULL;
}
do {
digit = value % radix;
value = value / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (value != 0L);
memcpy(string, pos, &buffer[32] - pos + 1);
return string;
}
-163
View File
@@ -1,163 +0,0 @@
#include <string.h>
#include <windows.h>
/*
* @implemented
* from wine cvs 2006-05-21
*/
wchar_t *
_i64tow(__int64 value, wchar_t *string, int radix)
{
ULONGLONG val;
int negative;
WCHAR buffer[65];
PWCHAR pos;
WCHAR digit;
if (value < 0 && radix == 10) {
negative = 1;
val = -value;
} else {
negative = 0;
val = value;
} /* if */
pos = &buffer[64];
*pos = '\0';
do {
digit = val % radix;
val = val / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (val != 0L);
if (negative) {
*--pos = '-';
} /* if */
if (string != NULL) {
memcpy(string, pos, (&buffer[64] - pos + 1) * sizeof(WCHAR));
} /* if */
return string;
}
/*
* @implemented
*/
wchar_t *
_ui64tow(unsigned __int64 value, wchar_t *string, int radix)
{
WCHAR buffer[65];
PWCHAR pos;
WCHAR digit;
pos = &buffer[64];
*pos = '\0';
do {
digit = value % radix;
value = value / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (value != 0L);
if (string != NULL) {
memcpy(string, pos, (&buffer[64] - pos + 1) * sizeof(WCHAR));
} /* if */
return string;
}
/*
* @implemented
* from wine cvs 2006-05-21
*/
wchar_t *
_itow(int value, wchar_t *string, int radix)
{
return _ltow(value, string, radix);
}
/*
* @implemented
* from wine cvs 2006-05-21
*/
wchar_t *
_ltow(long value, wchar_t *string, int radix)
{
unsigned long val;
int negative;
WCHAR buffer[33];
PWCHAR pos;
WCHAR digit;
if (value < 0 && radix == 10) {
negative = 1;
val = -value;
} else {
negative = 0;
val = value;
} /* if */
pos = &buffer[32];
*pos = '\0';
do {
digit = val % radix;
val = val / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (val != 0L);
if (negative) {
*--pos = '-';
} /* if */
if (string != NULL) {
memcpy(string, pos, (&buffer[32] - pos + 1) * sizeof(WCHAR));
} /* if */
return string;
}
/*
* @implemented
* from wine cvs 2006-05-21
*/
wchar_t *
_ultow(unsigned long value, wchar_t *string, int radix)
{
WCHAR buffer[33];
PWCHAR pos;
WCHAR digit;
pos = &buffer[32];
*pos = '\0';
do {
digit = value % radix;
value = value / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (value != 0L);
if (string != NULL) {
memcpy(string, pos, (&buffer[32] - pos + 1) * sizeof(WCHAR));
} /* if */
return string;
}
-20
View File
@@ -1,20 +0,0 @@
#include <string.h>
/*
* @implemented
*/
void *_lfind(const void *key, const void *base, size_t *nelp,
size_t width, int (*compar)(const void *, const void *))
{
const char* char_base = (const char *)base;
size_t i;
for (i = 0; i < *nelp; i++)
{
if (compar(key, char_base) == 0)
return (void *)((size_t)char_base);
char_base += width;
}
return NULL;
}
@@ -1,60 +0,0 @@
#define WIN32_NO_STATUS
#include <windows.h>
#include <ndk/umtypes.h>
#include <ndk/rtlfuncs.h>
#include <string.h>
/*
* @implemented
*/
int mbtowc (wchar_t *wchar, const char *mbchar, size_t count)
{
NTSTATUS Status;
ULONG Size;
if (wchar == NULL)
return 0;
Status = RtlMultiByteToUnicodeN (wchar,
sizeof(WCHAR),
&Size,
mbchar,
count);
if (!NT_SUCCESS(Status))
return -1;
return (int)Size;
}
/*
* @implemented
*/
size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count)
{
NTSTATUS Status;
ULONG Size;
ULONG Length;
Length = strlen (mbstr);
if (wcstr == NULL)
{
RtlMultiByteToUnicodeSize (&Size,
mbstr,
Length);
return (size_t)Size;
}
Status = RtlMultiByteToUnicodeN (wcstr,
count,
&Size,
mbstr,
Length);
if (!NT_SUCCESS(Status))
return -1;
return (size_t)Size;
}
/* EOF */
-547
View File
@@ -1,547 +0,0 @@
/*
* general implementation of scanf used by scanf, sscanf, fscanf,
* _cscanf, wscanf, swscanf and fwscanf
*
* Copyright 1996,1998 Marcus Meissner
* Copyright 1996 Jukka Iivonen
* Copyright 1997,2000, 2003 Uwe Bonnes
* Copyright 2000 Jon Griffiths
* Copyright 2002 Daniel Gudbjartsson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef WIDE_SCANF
#define _CHAR_ wchar_t
#define _EOF_ WEOF
#define _EOF_RET WEOF
#define _ISSPACE_(c) iswspace(c)
#define _ISDIGIT_(c) iswdigit(c)
#define _WIDE2SUPPORTED_(c) c /* No conversion needed (wide to wide) */
#define _CHAR2SUPPORTED_(c) c /* FIXME: convert char to wide char */
#define _CHAR2DIGIT_(c, base) wchar2digit((c), (base))
#define _BITMAPSIZE_ 256*256
#else /* WIDE_SCANF */
#define _CHAR_ char
#define _EOF_ EOF
#define _EOF_RET EOF
#define _ISSPACE_(c) isspace(c)
#define _ISDIGIT_(c) isdigit(c)
#define _WIDE2SUPPORTED_(c) c /* FIXME: convert wide char to char */
#define _CHAR2SUPPORTED_(c) c /* No conversion needed (char to char) */
#define _CHAR2DIGIT_(c, base) char2digit((c), (base))
#define _BITMAPSIZE_ 256
#endif /* WIDE_SCANF */
#ifdef CONSOLE
#define _GETC_(file) (consumed++, _getch())
#define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0)
#define _FUNCTION_ int vcscanf(const char *format, va_list ap)
#else
#ifdef STRING
#undef _EOF_
#define _EOF_ 0
#define _GETC_(file) (consumed++, *file++)
#define _UNGETC_(nch, file) do { file--; consumed--; } while(0)
#ifdef WIDE_SCANF
#define _FUNCTION_ int vswscanf(const wchar_t *file, const wchar_t *format, va_list ap)
#else /* WIDE_SCANF */
#define _FUNCTION_ int vsscanf(const char *file, const char *format, va_list ap)
#endif /* WIDE_SCANF */
#else /* STRING */
#ifdef WIDE_SCANF
#define _GETC_(file) (consumed++, fgetwc(file))
#define _UNGETC_(nch, file) do { ungetwc(nch, file); consumed--; } while(0)
#define _FUNCTION_ int vfwscanf(FILE* file, const wchar_t *format, va_list ap)
#else /* WIDE_SCANF */
#define _GETC_(file) (consumed++, fgetc(file))
#define _UNGETC_(nch, file) do { ungetc(nch, file); consumed--; } while(0)
#define _FUNCTION_ int vfscanf(FILE* file, const char *format, va_list ap)
#endif /* WIDE_SCANF */
#endif /* STRING */
#endif /* CONSOLE */
/*********************************************************************
* Implemented based on
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt_format_specification_fields_.2d_.scanf_and_wscanf_functions.asp
* Extended by C. Scott Ananian <[email protected]> to handle
* more types of format spec.
*/
_FUNCTION_ {
int rd = 0, consumed = 0;
int nch;
if (!*format) return 0;
nch = _GETC_(file);
if (nch == _EOF_) return _EOF_RET;
while (*format) {
/* a whitespace character in the format string causes scanf to read,
* but not store, all consecutive white-space characters in the input
* up to the next non-white-space character. One white space character
* in the input matches any number (including zero) and combination of
* white-space characters in the input. */
if (_ISSPACE_(*format)) {
/* skip whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
}
/* a format specification causes scanf to read and convert characters
* in the input into values of a specified type. The value is assigned
* to an argument in the argument list. Format specifications have
* the form %[*][width][{h | l | I64 | L}]type */
else if (*format == '%') {
int st = 0; int suppress = 0; int width = 0;
int base, number_signed;
int h_prefix = 0;
int l_prefix = 0;
int L_prefix = 0;
int w_prefix = 0;
int prefix_finished = 0;
int I64_prefix = 0;
format++;
/* look for leading asterisk, which means 'suppress assignment of
* this field'. */
if (*format=='*') {
format++;
suppress=1;
}
/* look for width specification */
while (_ISDIGIT_(*format)) {
width*=10;
width+=*format++ - '0';
}
if (width==0) width=-1; /* no width spec seen */
/* read prefix (if any) */
while (!prefix_finished) {
switch(*format) {
case 'h': h_prefix = 1; break;
case 'l': l_prefix = 1; break;
case 'w': w_prefix = 1; break;
case 'L': L_prefix = 1; break;
case 'I':
if (*(format + 1) == '6' &&
*(format + 2) == '4') {
I64_prefix = 1;
format += 2;
}
break;
default:
prefix_finished = 1;
}
if (!prefix_finished) format++;
}
/* read type */
switch(*format) {
case 'x':
case 'X': /* hexadecimal integer. */
base = 16; number_signed = 0;
goto number;
case 'o': /* octal integer */
base = 8; number_signed = 0;
goto number;
case 'u': /* unsigned decimal integer */
base = 10; number_signed = 0;
goto number;
case 'd': /* signed decimal integer */
base = 10; number_signed = 1;
goto number;
case 'i': /* generic integer */
base = 10; number_signed = 1;
number: {
/* read an integer */
ULONGLONG cur = 0;
int negative = 0;
int seendigit=0;
/* skip initial whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
/* get sign */
if (number_signed && (nch == '-' ||
nch == '+')) {
negative = (nch=='-');
nch = _GETC_(file);
if (width>0) width--;
}
/* look for leading indication of base */
if (width!=0 && nch == '0') {
nch = _GETC_(file);
if (width>0) width--;
seendigit=1;
if (width!=0 && (nch=='x' || nch=='X')) {
if (base==0)
base=16;
if (base==16) {
nch = _GETC_(file);
if (width>0) width--;
seendigit=0;
}
} else if (base==0)
base = 8;
}
/* throw away leading zeros */
while (width!=0 && nch=='0') {
nch = _GETC_(file);
if (width>0) width--;
seendigit=1;
}
if (width!=0 && _CHAR2DIGIT_(nch, base)!=-1) {
cur = _CHAR2DIGIT_(nch, base);
nch = _GETC_(file);
if (width>0) width--;
seendigit=1;
}
/* read until no more digits */
while (width!=0 && (nch!=_EOF_) && _CHAR2DIGIT_(nch, base)!=-1) {
cur = cur*base + _CHAR2DIGIT_(nch, base);
nch = _GETC_(file);
if (width>0) width--;
seendigit=1;
}
/* okay, done! */
if (!seendigit) break; /* not a valid number */
st = 1;
if (!suppress) {
#define _SET_NUMBER_(type) *va_arg(ap, type*) = negative ? -cur : cur
if (number_signed) {
if (I64_prefix) _SET_NUMBER_(LONGLONG);
else if (l_prefix) _SET_NUMBER_(long int);
else if (h_prefix) _SET_NUMBER_(short int);
else _SET_NUMBER_(int);
} else {
if (negative) {
negative = 0;
}
if (I64_prefix) _SET_NUMBER_(ULONGLONG);
else if (l_prefix) _SET_NUMBER_(unsigned long int);
else if (h_prefix)
_SET_NUMBER_(unsigned short int);
else _SET_NUMBER_(unsigned int);
}
}
}
break;
case 'e':
case 'E':
case 'f':
case 'g':
case 'G': { /* read a float */
long double cur = 0;
int negative = 0;
/* skip initial whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
/* get sign. */
if (nch == '-' || nch == '+') {
negative = (nch=='-');
if (width>0) width--;
if (width==0) break;
nch = _GETC_(file);
}
/* get first digit. */
if ('.' != nch) {
if (!_ISDIGIT_(nch)) break;
cur = (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
/* read until no more digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
cur = cur*10 + (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
}
} else {
cur = 0; /* MaxPayneDemo Fix: .8 -> 0.8 */
}
/* handle decimals */
if (width!=0 && nch == '.') {
float dec = 1;
nch = _GETC_(file);
if (width>0) width--;
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
dec /= 10;
cur += dec * (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
}
}
/* handle exponent */
if (width!=0 && (nch == 'e' || nch == 'E')) {
int exponent = 0, negexp = 0;
float expcnt;
nch = _GETC_(file);
if (width>0) width--;
/* possible sign on the exponent */
if (width!=0 && (nch=='+' || nch=='-')) {
negexp = (nch=='-');
nch = _GETC_(file);
if (width>0) width--;
}
/* exponent digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
exponent *= 10;
exponent += (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
}
/* update 'cur' with this exponent. */
expcnt = negexp ? .1 : 10;
while (exponent!=0) {
if (exponent&1)
cur*=expcnt;
exponent/=2;
expcnt=expcnt*expcnt;
}
}
st = 1;
if (!suppress) {
if (L_prefix) _SET_NUMBER_(long double);
else if (l_prefix) _SET_NUMBER_(double);
else _SET_NUMBER_(float);
}
}
break;
/* According to
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_scanf_type_field_characters.asp
* 's' reads a character string in a call to fscanf
* and 'S' a wide character string and vice versa in a
* call to fwscanf. The 'h', 'w' and 'l' prefixes override
* this behaviour. 'h' forces reading char * but 'l' and 'w'
* force reading WCHAR. */
case 's':
if (w_prefix || l_prefix) goto widecharstring;
else if (h_prefix) goto charstring;
#ifdef WIDE_SCANF
else goto widecharstring;
#else /* WIDE_SCANF */
else goto charstring;
#endif /* WIDE_SCANF */
case 'S':
if (w_prefix || l_prefix) goto widecharstring;
else if (h_prefix) goto charstring;
#ifdef WIDE_SCANF
else goto charstring;
#else /* WIDE_SCANF */
else goto widecharstring;
#endif /* WIDE_SCANF */
charstring: { /* read a word into a char */
char*str = suppress ? NULL : va_arg(ap, char*);
char*sptr = str;
/* skip initial whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
/* read until whitespace */
while (width!=0 && (nch!=_EOF_) && !_ISSPACE_(nch)) {
if (!suppress) *sptr++ = _CHAR2SUPPORTED_(nch);
st++;
nch = _GETC_(file);
if (width>0) width--;
}
/* terminate */
if (!suppress) *sptr = 0;
}
break;
widecharstring: { /* read a word into a wchar_t* */
wchar_t*str =
suppress ? NULL : va_arg(ap, wchar_t*);
wchar_t*sptr = str;
/* skip initial whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
/* read until whitespace */
while (width!=0 && (nch!=_EOF_) && !_ISSPACE_(nch)) {
if (!suppress) *sptr++ = _WIDE2SUPPORTED_(nch);
st++;
nch = _GETC_(file);
if (width>0) width--;
}
/* terminate */
if (!suppress) *sptr = 0;
}
break;
/* 'c' and 'C work analogously to 's' and 'S' as described
* above */
case 'c':
if (w_prefix || l_prefix) goto widecharacter;
else if (h_prefix) goto character;
#ifdef WIDE_SCANF
else goto widecharacter;
#else /* WIDE_SCANF */
else goto character;
#endif /* WIDE_SCANF */
case 'C':
if (w_prefix || l_prefix) goto widecharacter;
else if (h_prefix) goto character;
#ifdef WIDE_SCANF
else goto character;
#else /* WIDE_SCANF */
else goto widecharacter;
#endif /* WIDE_SCANF */
character: { /* read single character into char */
if (nch!=_EOF_) {
if (!suppress) {
char*c = va_arg(ap, char*);
*c = _CHAR2SUPPORTED_(nch);
}
st = 1;
nch = _GETC_(file);
}
}
break;
widecharacter: { /* read single character into a wchar_t */
if (nch!=_EOF_) {
if (!suppress) {
wchar_t*c = va_arg(ap, wchar_t*);
*c = _WIDE2SUPPORTED_(nch);
}
nch = _GETC_(file);
st = 1;
}
}
break;
case 'n': {
if (!suppress) {
int*n = va_arg(ap, int*);
/*
*n = consumed - (nch!=_EOF_);
FIXME: The above is the Wine version and it doesnt work in ros
when %n is at end of input string (return one too many).
But does it fail in Wine too?? If so wine also needs fixin.
-Gunnar
*/
*n = consumed - 1;
}
/* This is an odd one: according to the standard,
* "Execution of a %n directive does not increment the
* assignment count returned at the completion of
* execution" even if it wasn't suppressed with the
* '*' flag. The Corrigendum to the standard seems
* to contradict this (comment out the assignment to
* suppress below if you want to implement these
* alternate semantics) but the windows program I'm
* looking at expects the behavior I've coded here
* (which happens to be what glibc does as well).
*/
suppress = 1;
st = 1;
}
break;
case '[': {
_CHAR_ *str = suppress ? NULL : va_arg(ap, _CHAR_*);
_CHAR_ *sptr = str;
RTL_BITMAP bitMask;
ULONG *Mask;
int invert = 0; /* Set if we are NOT to find the chars */
/* Init our bitmap */
Mask = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8);
RtlInitializeBitMap(&bitMask, Mask, _BITMAPSIZE_);
/* Read the format */
format++;
if(*format == '^') {
invert = 1;
format++;
}
if(*format == ']') {
RtlSetBits(&bitMask, ']', 1);
format++;
}
while(*format && (*format != ']')) {
/* According to:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt_scanf_width_specification.asp
* "Note that %[a-z] and %[z-a] are interpreted as equivalent to %[abcde...z]." */
if((*format == '-') && (*(format + 1) != ']')) {
if ((*(format - 1)) < *(format + 1))
RtlSetBits(&bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1));
else
RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1));
format++;
} else
RtlSetBits(&bitMask, *format, 1);
format++;
}
/* read until char is not suitable */
while ((width != 0) && (nch != _EOF_)) {
if(!invert) {
if(RtlAreBitsSet(&bitMask, nch, 1)) {
if (!suppress) *sptr++ = _CHAR2SUPPORTED_(nch);
} else
break;
} else {
if(RtlAreBitsClear(&bitMask, nch, 1)) {
if (!suppress) *sptr++ = _CHAR2SUPPORTED_(nch);
} else
break;
}
st++;
nch = _GETC_(file);
if (width>0) width--;
}
/* terminate */
if (!suppress) *sptr = 0;
RtlFreeHeap(RtlGetProcessHeap(), 0, Mask);
}
break;
default:
/* From spec: "if a percent sign is followed by a character
* that has no meaning as a format-control character, that
* character and the following characters are treated as
* an ordinary sequence of characters, that is, a sequence
* of characters that must match the input. For example,
* to specify that a percent-sign character is to be input,
* use %%." */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
if (nch==*format) {
suppress = 1; /* whoops no field to be read */
st = 1; /* but we got what we expected */
nch = _GETC_(file);
}
break;
}
if (st && !suppress) rd++;
else if (!st) break;
}
/* a non-white-space character causes scanf to read, but not store,
* a matching non-white-space character. */
else {
/* check for character match */
if (nch == *format) {
nch = _GETC_(file);
} else break;
}
format++;
}
if (nch!=_EOF_) {
_UNGETC_(nch, file);
}
return rd;
}
#undef _CHAR_
#undef _EOF_
#undef _EOF_RET
#undef _ISSPACE_
#undef _ISDIGIT_
#undef _CHAR2SUPPORTED_
#undef _WIDE2SUPPORTED_
#undef _CHAR2DIGIT_
#undef _GETC_
#undef _UNGETC_
#undef _FUNCTION_
#undef _BITMAPSIZE_
-50
View File
@@ -1,50 +0,0 @@
#include <string.h>
/*
* @implemented
*/
void _splitpath(const char* path, char* drive, char* dir, char* fname, char* ext)
{
const char* tmp_drive;
const char* tmp_dir;
const char* tmp_ext;
tmp_drive = strchr(path,':');
if (drive) {
if (tmp_drive) {
strncpy(drive,tmp_drive-1,2);
*(drive+2) = 0;
} else {
*drive = 0;
}
}
if (!tmp_drive) {
tmp_drive = path - 1;
}
tmp_dir = (char*)strrchr(path,'\\');
if (dir) {
if (tmp_dir) {
strncpy(dir,tmp_drive+1,tmp_dir-tmp_drive);
*(dir+(tmp_dir-tmp_drive)) = 0;
} else {
*dir =0;
}
}
tmp_ext = strrchr(path,'.');
if (!tmp_ext) {
tmp_ext = path+strlen(path);
}
if (ext) {
strcpy(ext,tmp_ext);
}
if (tmp_dir) {
strncpy(fname,tmp_dir+1,tmp_ext-tmp_dir-1);
*(fname+(tmp_ext-tmp_dir-1)) = 0;
} else {
strncpy(fname,tmp_drive+1,tmp_ext-tmp_drive-1);
*(fname+(tmp_ext-path))=0;
}
}
-7
View File
@@ -1,7 +0,0 @@
/* $Id$
*/
#include <string.h>
#include "tcscat.h"
/* EOF */
-8
View File
@@ -1,8 +0,0 @@
/* $Id$
*/
#define _XINT int
#include <string.h>
#include "tcschr.h"
/* EOF */
-7
View File
@@ -1,7 +0,0 @@
/* $Id$
*/
#include <string.h>
#include "tcscmp.h"
/* EOF */
-7
View File
@@ -1,7 +0,0 @@
/* $Id$
*/
#include <string.h>
#include "tcscpy.h"
/* EOF */
-27
View File
@@ -1,27 +0,0 @@
#include <string.h>
#include <ctype.h>
/*
* @implemented
*/
int
_stricmp(const char *s1, const char *s2)
{
while (toupper(*s1) == toupper(*s2))
{
if (*s1 == 0)
return 0;
s1++;
s2++;
}
return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)(s2));
}
/*
* @implemented
*/
int
_strcmpi(const char *s1, const char *s2)
{
return _stricmp(s1,s2);
}
-7
View File
@@ -1,7 +0,0 @@
/* $Id$
*/
#include <string.h>
#include "tcslen.h"
/* EOF */
-17
View File
@@ -1,17 +0,0 @@
#include <string.h>
#include <ctype.h>
/*
* @implemented
*/
char * _strlwr(char *x)
{
char *y=x;
while (*y) {
*y=tolower(*y);
y++;
}
return x;
}
@@ -1,7 +0,0 @@
/* $Id$
*/
#include <string.h>
#include "tcsncat.h"
/* EOF */

Some files were not shown because too many files have changed in this diff Show More