diff --git a/reactos/lib/sdk/crt/README.txt b/reactos/lib/sdk/crt/README.txt index 8853dceee74..457352e96c6 100644 --- a/reactos/lib/sdk/crt/README.txt +++ b/reactos/lib/sdk/crt/README.txt @@ -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. ???? diff --git a/reactos/lib/sdk/libcntpr/libcntpr.h b/reactos/lib/sdk/crt/libcntpr.h similarity index 95% rename from reactos/lib/sdk/libcntpr/libcntpr.h rename to reactos/lib/sdk/crt/libcntpr.h index 5bdbc9e69c8..e1b955a9a34 100644 --- a/reactos/lib/sdk/libcntpr/libcntpr.h +++ b/reactos/lib/sdk/crt/libcntpr.h @@ -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 -#include - -#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 +#include + +#endif /* _LIBCNT_ */ + +/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/libcntpr.rbuild b/reactos/lib/sdk/crt/libcntpr.rbuild similarity index 88% rename from reactos/lib/sdk/libcntpr/libcntpr.rbuild rename to reactos/lib/sdk/crt/libcntpr.rbuild index eea6751dfe4..fdb4abb09b8 100644 --- a/reactos/lib/sdk/libcntpr/libcntpr.rbuild +++ b/reactos/lib/sdk/crt/libcntpr.rbuild @@ -1,162 +1,177 @@ - - - - - - - - - - "extern __attribute__ ((dllexport))" - - . - - - - - chkstk_asm.s - seh.s - - - - - chkstk_asm.s - seh.s - - - - - - - alldiv_asm.s - alldvrm_asm.s - allmul_asm.s - allrem_asm.s - allshl_asm.s - allshr_asm.s - atan_asm.s - aulldiv_asm.s - aulldvrm_asm.s - aullrem_asm.s - aullshr_asm.s - ceil_asm.s - cos_asm.s - fabs_asm.s - floor_asm.s - ftol_asm.s - log_asm.s - pow_asm.s - sin_asm.s - sqrt_asm.s - tan_asm.s - - - abs.c - bsearch.c - labs.c - rand.c - - - - - - memchr_asm.s - memcpy_asm.s - memmove_asm.s - memset_asm.s - - - - memchr.c - memcpy.c - memmove.c - memset.c - - memccpy.c - memcmp.c - memicmp.c - - - - - - strcat_asm.s - strchr_asm.s - strcmp_asm.s - strcpy_asm.s - strlen_asm.s - strncat_asm.s - strncmp_asm.s - strncpy_asm.s - strnlen_asm.s - strrchr_asm.s - wcscat_asm.s - wcschr_asm.s - wcscmp_asm.s - wcscpy_asm.s - wcslen_asm.s - wcsncat_asm.s - wcsncmp_asm.s - wcsncpy_asm.s - wcsnlen_asm.s - wcsrchr_asm.s - - - - strcat.c - strchr.c - strcmp.c - strcpy.c - strlen.c - strncat.c - strncmp.c - strncpy.c - strnlen.c - strrchr.c - wcscat.c - wcschr.c - wcscmp.c - wcscpy.c - wcslen.c - wcsncat.c - wcsncmp.c - wcsncpy.c - wcsnlen.c - wcsrchr.c - - ctype.c - strcspn.c - stricmp.c - strnicmp.c - strlwr.c - strrev.c - strset.c - strstr.c - strupr.c - strpbrk.c - strspn.c - wstring.c - wcsrev.c - wcsnset.c - atoi64.c - atoi.c - atol.c - itoa.c - itow.c - lfind.c - mbstowcs.c - splitp.c - strtol.c - strtoul.c - strtoull.c - wcstol.c - wcstombs.c - wcstoul.c - wtoi64.c - wtoi.c - wtol.c - sscanf.c - - - libcntpr.h - + + + + . + include + + + + + + + + "extern __attribute__ ((dllexport))" + + + + + + chkstk_asm.s + seh.s + + + + + chkstk_asm.s + seh.s + + + + + + + alldiv_asm.s + alldvrm_asm.s + allmul_asm.s + allrem_asm.s + allshl_asm.s + allshr_asm.s + atan_asm.s + aulldiv_asm.s + aulldvrm_asm.s + aullrem_asm.s + aullshr_asm.s + ceil_asm.s + cos_asm.s + fabs_asm.s + floor_asm.s + ftol_asm.s + log_asm.s + pow_asm.s + sin_asm.s + sqrt_asm.s + tan_asm.s + + + abs.c + labs.c + rand_nt.c + + + + + + memchr_asm.s + memcpy_asm.s + memmove_asm.s + memset_asm.s + + + + memchr.c + memcpy.c + memmove.c + memset.c + + memccpy.c + memcmp.c + memicmp.c + + + + bsearch.c + lfind.c + + + + + + strcat_asm.s + strchr_asm.s + strcmp_asm.s + strcpy_asm.s + strlen_asm.s + strncat_asm.s + strncmp_asm.s + strncpy_asm.s + strnlen_asm.s + strrchr_asm.s + wcscat_asm.s + wcschr_asm.s + wcscmp_asm.s + wcscpy_asm.s + wcslen_asm.s + wcsncat_asm.s + wcsncmp_asm.s + wcsncpy_asm.s + wcsnlen_asm.s + wcsrchr_asm.s + + + + strcat.c + strchr.c + strcmp.c + strcpy.c + strlen.c + strncat.c + strncmp.c + strncpy.c + strnlen.c + strrchr.c + wcscat.c + wcschr.c + wcscmp.c + wcscpy.c + wcslen.c + wcsncat.c + wcsncmp.c + wcsncpy.c + wcsnlen.c + wcsrchr.c + + ctype.c + strcspn.c + stricmp.c + strnicmp.c + strlwr.c + strrev.c + strset.c + strstr.c + strupr.c + strpbrk.c + strspn.c + atoi64.c + atoi.c + atol.c + itoa.c + itow.c + mbstowcs_nt.c + splitp.c + sscanf.c + strtol.c + strtoul.c + strtoull.c + wcstol.c + wcstombs_nt.c + wcstoul.c + wtoi64.c + wtoi.c + wtol.c + + + + wcsicmp.c + wcslwr.c + wcsnicmp.c + wcsupr.c + wcscspn.c + wcspbrk.c + wcsset.c + wcsspn.c + wcsstr.c + wcsrev.c + + + precomp.h + diff --git a/reactos/lib/sdk/libcntpr/math/i386/alldiv_asm.s b/reactos/lib/sdk/crt/math/i386/alldiv_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/alldiv_asm.s rename to reactos/lib/sdk/crt/math/i386/alldiv_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/alldvrm_asm.s b/reactos/lib/sdk/crt/math/i386/alldvrm_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/alldvrm_asm.s rename to reactos/lib/sdk/crt/math/i386/alldvrm_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/allmul_asm.s b/reactos/lib/sdk/crt/math/i386/allmul_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/allmul_asm.s rename to reactos/lib/sdk/crt/math/i386/allmul_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/allrem_asm.s b/reactos/lib/sdk/crt/math/i386/allrem_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/allrem_asm.s rename to reactos/lib/sdk/crt/math/i386/allrem_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/allshl_asm.s b/reactos/lib/sdk/crt/math/i386/allshl_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/allshl_asm.s rename to reactos/lib/sdk/crt/math/i386/allshl_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/allshr_asm.s b/reactos/lib/sdk/crt/math/i386/allshr_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/allshr_asm.s rename to reactos/lib/sdk/crt/math/i386/allshr_asm.s diff --git a/reactos/lib/sdk/crt/math/i386/atan_asm.s b/reactos/lib/sdk/crt/math/i386/atan_asm.s index 6b21e2d49da..37554c940ae 100644 --- a/reactos/lib/sdk/crt/math/i386/atan_asm.s +++ b/reactos/lib/sdk/crt/math/i386/atan_asm.s @@ -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 diff --git a/reactos/lib/sdk/libcntpr/math/i386/aulldiv_asm.s b/reactos/lib/sdk/crt/math/i386/aulldiv_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/aulldiv_asm.s rename to reactos/lib/sdk/crt/math/i386/aulldiv_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/aulldvrm_asm.s b/reactos/lib/sdk/crt/math/i386/aulldvrm_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/aulldvrm_asm.s rename to reactos/lib/sdk/crt/math/i386/aulldvrm_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/aullrem_asm.s b/reactos/lib/sdk/crt/math/i386/aullrem_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/aullrem_asm.s rename to reactos/lib/sdk/crt/math/i386/aullrem_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/aullshr_asm.s b/reactos/lib/sdk/crt/math/i386/aullshr_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/aullshr_asm.s rename to reactos/lib/sdk/crt/math/i386/aullshr_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/ceil_asm.s b/reactos/lib/sdk/crt/math/i386/ceil_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/ceil_asm.s rename to reactos/lib/sdk/crt/math/i386/ceil_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/cos_asm.s b/reactos/lib/sdk/crt/math/i386/cos_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/cos_asm.s rename to reactos/lib/sdk/crt/math/i386/cos_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/fabs_asm.s b/reactos/lib/sdk/crt/math/i386/fabs_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/fabs_asm.s rename to reactos/lib/sdk/crt/math/i386/fabs_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/floor_asm.s b/reactos/lib/sdk/crt/math/i386/floor_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/floor_asm.s rename to reactos/lib/sdk/crt/math/i386/floor_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/ftol_asm.s b/reactos/lib/sdk/crt/math/i386/ftol_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/ftol_asm.s rename to reactos/lib/sdk/crt/math/i386/ftol_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/log_asm.s b/reactos/lib/sdk/crt/math/i386/log_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/log_asm.s rename to reactos/lib/sdk/crt/math/i386/log_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/sin_asm.s b/reactos/lib/sdk/crt/math/i386/sin_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/sin_asm.s rename to reactos/lib/sdk/crt/math/i386/sin_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/sqrt_asm.s b/reactos/lib/sdk/crt/math/i386/sqrt_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/sqrt_asm.s rename to reactos/lib/sdk/crt/math/i386/sqrt_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/i386/tan_asm.s b/reactos/lib/sdk/crt/math/i386/tan_asm.s similarity index 100% rename from reactos/lib/sdk/libcntpr/math/i386/tan_asm.s rename to reactos/lib/sdk/crt/math/i386/tan_asm.s diff --git a/reactos/lib/sdk/libcntpr/math/rand.c b/reactos/lib/sdk/crt/math/rand_nt.c similarity index 100% rename from reactos/lib/sdk/libcntpr/math/rand.c rename to reactos/lib/sdk/crt/math/rand_nt.c diff --git a/reactos/lib/sdk/crt/string/atoi.c b/reactos/lib/sdk/crt/string/atoi.c index 99a6eda4371..74f3175565e 100644 --- a/reactos/lib/sdk/crt/string/atoi.c +++ b/reactos/lib/sdk/crt/string/atoi.c @@ -1,5 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include +#include /* * @implemented diff --git a/reactos/lib/sdk/crt/string/splitp.c b/reactos/lib/sdk/crt/string/splitp.c index 29c4e369cc6..ea41fb08c03 100644 --- a/reactos/lib/sdk/crt/string/splitp.c +++ b/reactos/lib/sdk/crt/string/splitp.c @@ -1,4 +1,5 @@ #include +#include /* * @implemented diff --git a/reactos/lib/sdk/libcntpr/string/sscanf.c b/reactos/lib/sdk/crt/string/sscanf.c similarity index 82% rename from reactos/lib/sdk/libcntpr/string/sscanf.c rename to reactos/lib/sdk/crt/string/sscanf.c index fdb2bc78363..bd3b446dc6d 100644 --- a/reactos/lib/sdk/libcntpr/string/sscanf.c +++ b/reactos/lib/sdk/crt/string/sscanf.c @@ -1,10 +1,13 @@ -/**/ -#define WIN32_NO_STATUS -#include -#include -#include -#include -#include +#include + +#include +#include + +#define NDEBUG +#include + +#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, ...) { diff --git a/reactos/lib/sdk/libcntpr/string/strcspn.c b/reactos/lib/sdk/crt/string/strcspn.c similarity index 100% rename from reactos/lib/sdk/libcntpr/string/strcspn.c rename to reactos/lib/sdk/crt/string/strcspn.c diff --git a/reactos/lib/sdk/libcntpr/string/strspn.c b/reactos/lib/sdk/crt/string/strspn.c similarity index 100% rename from reactos/lib/sdk/libcntpr/string/strspn.c rename to reactos/lib/sdk/crt/string/strspn.c diff --git a/reactos/lib/sdk/libcntpr/string/strxspn.h b/reactos/lib/sdk/crt/string/strxspn.h similarity index 100% rename from reactos/lib/sdk/libcntpr/string/strxspn.h rename to reactos/lib/sdk/crt/string/strxspn.h diff --git a/reactos/lib/sdk/crt/wine/scanf.h b/reactos/lib/sdk/crt/wine/scanf.h index eb2213884cb..632722ed5c7 100644 --- a/reactos/lib/sdk/crt/wine/scanf.h +++ b/reactos/lib/sdk/crt/wine/scanf.h @@ -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: diff --git a/reactos/lib/sdk/libcntpr/except/i386/chkstk_asm.s b/reactos/lib/sdk/libcntpr/except/i386/chkstk_asm.s deleted file mode 100644 index 5104a35b1c4..00000000000 --- a/reactos/lib/sdk/libcntpr/except/i386/chkstk_asm.s +++ /dev/null @@ -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 - */ - -.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 */ diff --git a/reactos/lib/sdk/libcntpr/except/i386/seh.s b/reactos/lib/sdk/libcntpr/except/i386/seh.s deleted file mode 100644 index 5b2bc36a9b8..00000000000 --- a/reactos/lib/sdk/libcntpr/except/i386/seh.s +++ /dev/null @@ -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 -.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 diff --git a/reactos/lib/sdk/libcntpr/except/powerpc/chkstk_asm.s b/reactos/lib/sdk/libcntpr/except/powerpc/chkstk_asm.s deleted file mode 100644 index 653fec4dd07..00000000000 --- a/reactos/lib/sdk/libcntpr/except/powerpc/chkstk_asm.s +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/except/powerpc/seh.s b/reactos/lib/sdk/libcntpr/except/powerpc/seh.s deleted file mode 100644 index 4965d634b9b..00000000000 --- a/reactos/lib/sdk/libcntpr/except/powerpc/seh.s +++ /dev/null @@ -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 - -#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 diff --git a/reactos/lib/sdk/libcntpr/math/abs.c b/reactos/lib/sdk/libcntpr/math/abs.c deleted file mode 100644 index d78ddb52dc5..00000000000 --- a/reactos/lib/sdk/libcntpr/math/abs.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -/* - * @implemented - */ -int -abs(int j) -{ - return j<0 ? -j : j; -} diff --git a/reactos/lib/sdk/libcntpr/math/bsearch.c b/reactos/lib/sdk/libcntpr/math/bsearch.c deleted file mode 100644 index 01d53f32f73..00000000000 --- a/reactos/lib/sdk/libcntpr/math/bsearch.c +++ /dev/null @@ -1,27 +0,0 @@ -#include - -/* - * @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; -} diff --git a/reactos/lib/sdk/libcntpr/math/i386/atan_asm.s b/reactos/lib/sdk/libcntpr/math/i386/atan_asm.s deleted file mode 100644 index 37554c940ae..00000000000 --- a/reactos/lib/sdk/libcntpr/math/i386/atan_asm.s +++ /dev/null @@ -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 diff --git a/reactos/lib/sdk/libcntpr/math/i386/pow_asm.s b/reactos/lib/sdk/libcntpr/math/i386/pow_asm.s deleted file mode 100644 index d59fbb754e5..00000000000 --- a/reactos/lib/sdk/libcntpr/math/i386/pow_asm.s +++ /dev/null @@ -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 diff --git a/reactos/lib/sdk/libcntpr/math/labs.c b/reactos/lib/sdk/libcntpr/math/labs.c deleted file mode 100644 index ecbf89b14ef..00000000000 --- a/reactos/lib/sdk/libcntpr/math/labs.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -/* - * @implemented - */ -long -labs(long j) -{ - return j<0 ? -j : j; -} diff --git a/reactos/lib/sdk/libcntpr/mem/i386/memchr_asm.s b/reactos/lib/sdk/libcntpr/mem/i386/memchr_asm.s deleted file mode 100644 index f044a1d72f1..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/i386/memchr_asm.s +++ /dev/null @@ -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 - diff --git a/reactos/lib/sdk/libcntpr/mem/i386/memcpy_asm.s b/reactos/lib/sdk/libcntpr/mem/i386/memcpy_asm.s deleted file mode 100644 index 370d9d89eb6..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/i386/memcpy_asm.s +++ /dev/null @@ -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 - diff --git a/reactos/lib/sdk/libcntpr/mem/i386/memmove_asm.s b/reactos/lib/sdk/libcntpr/mem/i386/memmove_asm.s deleted file mode 100644 index 6b33fed451b..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/i386/memmove_asm.s +++ /dev/null @@ -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 - diff --git a/reactos/lib/sdk/libcntpr/mem/i386/memset_asm.s b/reactos/lib/sdk/libcntpr/mem/i386/memset_asm.s deleted file mode 100644 index 4f7c9436e71..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/i386/memset_asm.s +++ /dev/null @@ -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 - diff --git a/reactos/lib/sdk/libcntpr/mem/memccpy.c b/reactos/lib/sdk/libcntpr/mem/memccpy.c deleted file mode 100644 index c760b85021e..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memccpy.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * $Id$ - */ - -#include - - -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 */ -} diff --git a/reactos/lib/sdk/libcntpr/mem/memchr.c b/reactos/lib/sdk/libcntpr/mem/memchr.c deleted file mode 100644 index 9a9ce8af3fc..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memchr.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * $Id$ - */ - -#include - -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; -} diff --git a/reactos/lib/sdk/libcntpr/mem/memcmp.c b/reactos/lib/sdk/libcntpr/mem/memcmp.c deleted file mode 100644 index 078238ebd20..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memcmp.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * $Id$ - */ - -#include - -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; -} diff --git a/reactos/lib/sdk/libcntpr/mem/memcpy.c b/reactos/lib/sdk/libcntpr/mem/memcpy.c deleted file mode 100644 index edcf5c1746b..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memcpy.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * $Id$ - */ - -#include - -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; -} diff --git a/reactos/lib/sdk/libcntpr/mem/memicmp.c b/reactos/lib/sdk/libcntpr/mem/memicmp.c deleted file mode 100644 index 26a27f1812b..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memicmp.c +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -/* - * @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; -} diff --git a/reactos/lib/sdk/libcntpr/mem/memmove.c b/reactos/lib/sdk/libcntpr/mem/memmove.c deleted file mode 100644 index 0cca512af10..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memmove.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * $Id$ - */ - -#include - - -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; -} diff --git a/reactos/lib/sdk/libcntpr/mem/memset.c b/reactos/lib/sdk/libcntpr/mem/memset.c deleted file mode 100644 index 692c09dc620..00000000000 --- a/reactos/lib/sdk/libcntpr/mem/memset.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * $Id$ - */ - -#include - -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; -} diff --git a/reactos/lib/sdk/libcntpr/string/atoi.c b/reactos/lib/sdk/libcntpr/string/atoi.c deleted file mode 100644 index 488593ce3d9..00000000000 --- a/reactos/lib/sdk/libcntpr/string/atoi.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -/* - * @implemented - */ -int -atoi(const char *str) -{ - return (int)strtol(str, 0, 10); -} diff --git a/reactos/lib/sdk/libcntpr/string/atoi64.c b/reactos/lib/sdk/libcntpr/string/atoi64.c deleted file mode 100644 index 37341acdf40..00000000000 --- a/reactos/lib/sdk/libcntpr/string/atoi64.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -/* - * @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 */ diff --git a/reactos/lib/sdk/libcntpr/string/atol.c b/reactos/lib/sdk/libcntpr/string/atol.c deleted file mode 100644 index 8dbf9fa3418..00000000000 --- a/reactos/lib/sdk/libcntpr/string/atol.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -/* - * @implemented - */ -long -atol(const char *str) -{ - return strtol(str, 0, 10); -} diff --git a/reactos/lib/sdk/libcntpr/string/ctype.c b/reactos/lib/sdk/libcntpr/string/ctype.c deleted file mode 100644 index 6d77a26e5ab..00000000000 --- a/reactos/lib/sdk/libcntpr/string/ctype.c +++ /dev/null @@ -1,591 +0,0 @@ -#include -#include - -#undef _pctype - -#define upalpha ('A' - 'a') - - -unsigned short _ctype[] = { - 0, /* , 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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strcat_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strcat_asm.s deleted file mode 100644 index 1241e78f7bb..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strcat_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcscat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strchr_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strchr_asm.s deleted file mode 100644 index b90e86d3303..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strchr_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcschr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strcmp_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strcmp_asm.s deleted file mode 100644 index 3ee6573f700..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strcmp_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcscmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strcpy_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strcpy_asm.s deleted file mode 100644 index 1b77403847c..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strcpy_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcscpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strlen_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strlen_asm.s deleted file mode 100644 index 9bb10b6d91b..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strlen_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcslen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strncat_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strncat_asm.s deleted file mode 100644 index 52b20671625..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strncat_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcsncat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strncmp_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strncmp_asm.s deleted file mode 100644 index 30c64e6b664..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strncmp_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcsncmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strncpy_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strncpy_asm.s deleted file mode 100644 index 7409b4ed6c7..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strncpy_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcsncpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strnlen_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strnlen_asm.s deleted file mode 100644 index be35b3ca2c2..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strnlen_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcsnlen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/strrchr_asm.s b/reactos/lib/sdk/libcntpr/string/i386/strrchr_asm.s deleted file mode 100644 index a8a9d5e79ac..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/strrchr_asm.s +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ - -#include "tcsrchr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tchar.h b/reactos/lib/sdk/libcntpr/string/i386/tchar.h deleted file mode 100644 index ce2f1b9666d..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tchar.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcscat.h b/reactos/lib/sdk/libcntpr/string/i386/tcscat.h deleted file mode 100644 index e50676528d8..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcscat.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcschr.h b/reactos/lib/sdk/libcntpr/string/i386/tcschr.h deleted file mode 100644 index ea08bb8d22e..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcschr.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h b/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h deleted file mode 100644 index 6830a0ba0dc..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h b/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h deleted file mode 100644 index cb89a43a4a8..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcslen.h b/reactos/lib/sdk/libcntpr/string/i386/tcslen.h deleted file mode 100644 index 8c9586da70d..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcslen.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h b/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h deleted file mode 100644 index f7a3b616396..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h b/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h deleted file mode 100644 index 58a30859e73..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h b/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h deleted file mode 100644 index ed15334d036..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsnlen.h b/reactos/lib/sdk/libcntpr/string/i386/tcsnlen.h deleted file mode 100644 index 90a4ec6c88c..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsnlen.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h b/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h deleted file mode 100644 index 61d3a4dd863..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h +++ /dev/null @@ -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcscat_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcscat_asm.s deleted file mode 100644 index 56beb026aa3..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcscat_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcscat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcschr_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcschr_asm.s deleted file mode 100644 index a493a48d237..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcschr_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcschr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcscmp_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcscmp_asm.s deleted file mode 100644 index 2377a026b78..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcscmp_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcscmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcscpy_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcscpy_asm.s deleted file mode 100644 index 7e76864972d..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcscpy_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcscpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcslen_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcslen_asm.s deleted file mode 100644 index f70390048ad..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcslen_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcslen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcsncat_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcsncat_asm.s deleted file mode 100644 index 36e2cf15dc6..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcsncat_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcsncat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcsncmp_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcsncmp_asm.s deleted file mode 100644 index 594e2c49340..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcsncmp_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcsncmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcsncpy_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcsncpy_asm.s deleted file mode 100644 index 601e70cdafe..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcsncpy_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcsncpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcsnlen_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcsnlen_asm.s deleted file mode 100644 index 65bd605231c..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcsnlen_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcsnlen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/i386/wcsrchr_asm.s b/reactos/lib/sdk/libcntpr/string/i386/wcsrchr_asm.s deleted file mode 100644 index 872403a8956..00000000000 --- a/reactos/lib/sdk/libcntpr/string/i386/wcsrchr_asm.s +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include "tcsrchr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/itoa.c b/reactos/lib/sdk/libcntpr/string/itoa.c deleted file mode 100644 index cf35ac8a602..00000000000 --- a/reactos/lib/sdk/libcntpr/string/itoa.c +++ /dev/null @@ -1,161 +0,0 @@ -#include -#include -#include - -/* - * @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; -} diff --git a/reactos/lib/sdk/libcntpr/string/itow.c b/reactos/lib/sdk/libcntpr/string/itow.c deleted file mode 100644 index ba8b3bc1131..00000000000 --- a/reactos/lib/sdk/libcntpr/string/itow.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include - -/* - * @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; -} diff --git a/reactos/lib/sdk/libcntpr/string/lfind.c b/reactos/lib/sdk/libcntpr/string/lfind.c deleted file mode 100644 index 40b6550cdd5..00000000000 --- a/reactos/lib/sdk/libcntpr/string/lfind.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -/* - * @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; -} diff --git a/reactos/lib/sdk/libcntpr/string/mbstowcs.c b/reactos/lib/sdk/libcntpr/string/mbstowcs.c deleted file mode 100644 index 8ab1edd23e3..00000000000 --- a/reactos/lib/sdk/libcntpr/string/mbstowcs.c +++ /dev/null @@ -1,60 +0,0 @@ -#define WIN32_NO_STATUS -#include -#include -#include -#include - -/* - * @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 */ diff --git a/reactos/lib/sdk/libcntpr/string/scanf.h b/reactos/lib/sdk/libcntpr/string/scanf.h deleted file mode 100644 index 25180db20b9..00000000000 --- a/reactos/lib/sdk/libcntpr/string/scanf.h +++ /dev/null @@ -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 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_ diff --git a/reactos/lib/sdk/libcntpr/string/splitp.c b/reactos/lib/sdk/libcntpr/string/splitp.c deleted file mode 100644 index 4728538ddf9..00000000000 --- a/reactos/lib/sdk/libcntpr/string/splitp.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -/* - * @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; - } -} - diff --git a/reactos/lib/sdk/libcntpr/string/strcat.c b/reactos/lib/sdk/libcntpr/string/strcat.c deleted file mode 100644 index 59aee1a90fd..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strcat.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcscat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strchr.c b/reactos/lib/sdk/libcntpr/string/strchr.c deleted file mode 100644 index e504e4bcd90..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strchr.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _XINT int -#include -#include "tcschr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strcmp.c b/reactos/lib/sdk/libcntpr/string/strcmp.c deleted file mode 100644 index df8e1408196..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strcmp.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcscmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strcpy.c b/reactos/lib/sdk/libcntpr/string/strcpy.c deleted file mode 100644 index 9f09b15be97..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strcpy.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcscpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/stricmp.c b/reactos/lib/sdk/libcntpr/string/stricmp.c deleted file mode 100644 index caaf2798311..00000000000 --- a/reactos/lib/sdk/libcntpr/string/stricmp.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -/* - * @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); -} diff --git a/reactos/lib/sdk/libcntpr/string/strlen.c b/reactos/lib/sdk/libcntpr/string/strlen.c deleted file mode 100644 index 7dd8d68c170..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strlen.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcslen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strlwr.c b/reactos/lib/sdk/libcntpr/string/strlwr.c deleted file mode 100644 index c19a78ac4bb..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strlwr.c +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - - -/* - * @implemented - */ -char * _strlwr(char *x) -{ - char *y=x; - - while (*y) { - *y=tolower(*y); - y++; - } - return x; -} diff --git a/reactos/lib/sdk/libcntpr/string/strncat.c b/reactos/lib/sdk/libcntpr/string/strncat.c deleted file mode 100644 index b2390f55da6..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strncat.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcsncat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strncmp.c b/reactos/lib/sdk/libcntpr/string/strncmp.c deleted file mode 100644 index 383782206d6..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strncmp.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcsncmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strncpy.c b/reactos/lib/sdk/libcntpr/string/strncpy.c deleted file mode 100644 index c172eb7cc4d..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strncpy.c +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ - */ -#include -#include "tcsncpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strnicmp.c b/reactos/lib/sdk/libcntpr/string/strnicmp.c deleted file mode 100644 index 749d4db22f2..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strnicmp.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -/* - - * @implemented - */ -int _strnicmp(const char *s1, const char *s2, size_t n) -{ - - if (n == 0) - return 0; - do { - if (toupper(*s1) != toupper(*s2++)) - return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)--s2); - if (*s1++ == 0) - break; - } while (--n != 0); - return 0; -} diff --git a/reactos/lib/sdk/libcntpr/string/strnlen.c b/reactos/lib/sdk/libcntpr/string/strnlen.c deleted file mode 100644 index 269c4953561..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strnlen.c +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id$ - */ - -#include -#include "tcsnlen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strpbrk.c b/reactos/lib/sdk/libcntpr/string/strpbrk.c deleted file mode 100644 index dc05fbc8c78..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strpbrk.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id$ - */ -#include -#include - -#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; -} - diff --git a/reactos/lib/sdk/libcntpr/string/strrchr.c b/reactos/lib/sdk/libcntpr/string/strrchr.c deleted file mode 100644 index 152561537c8..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strrchr.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _XINT int -#include -#include "tcsrchr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/strrev.c b/reactos/lib/sdk/libcntpr/string/strrev.c deleted file mode 100644 index 6a8b39b2a3e..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strrev.c +++ /dev/null @@ -1,24 +0,0 @@ -#include - -/* - * @implemented - */ -char * _strrev(char *s) -{ - char *e; - char a; - - e = s; - while (*e) - e++; - - while (s - -/* - * @implemented - */ -char* _strnset(char* szToFill, int szFill, size_t sizeMaxFill) -{ - char *t = szToFill; - int i = 0; - while (*szToFill != 0 && i < (int) sizeMaxFill) - { - *szToFill = szFill; - szToFill++; - i++; - - } - return t; -} - -/* - * @implemented - */ -char* _strset(char* szToFill, int szFill) -{ - char *t = szToFill; - while (*szToFill != 0) - { - *szToFill = szFill; - szToFill++; - - } - return t; -} diff --git a/reactos/lib/sdk/libcntpr/string/strstr.c b/reactos/lib/sdk/libcntpr/string/strstr.c deleted file mode 100644 index 7e5127b702b..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strstr.c +++ /dev/null @@ -1,24 +0,0 @@ -#include - -/* - * @implemented - */ -char * -strstr(const char *s, const char *find) -{ - char c, sc; - size_t len; - - if ((c = *find++) != 0) - { - len = strlen(find); - do { - do { - if ((sc = *s++) == 0) - return 0; - } while (sc != c); - } while (strncmp(s, find, len) != 0); - s--; - } - return (char *)((size_t)s); -} diff --git a/reactos/lib/sdk/libcntpr/string/strtol.c b/reactos/lib/sdk/libcntpr/string/strtol.c deleted file mode 100644 index b90b44d3fac..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strtol.c +++ /dev/null @@ -1,90 +0,0 @@ -#include -#include -#include - -/* - * @implemented - */ -long -strtol(const char *nptr, char **endptr, int base) -{ - const char *s = nptr; - unsigned long acc; - int c; - unsigned long cutoff; - int neg = 0, any, cutlim; - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') - { - neg = 1; - c = *s++; - } - else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) - { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - - /* - * Compute the cutoff value between legal numbers and illegal - * numbers. That is the largest legal value, divided by the - * base. An input number that is greater than this value, if - * followed by a legal input character, is too big. One that - * is equal to this value may be valid or not; the limit - * between valid and invalid numbers is then based on the last - * digit. For instance, if the range for longs is - * [-2147483648..2147483647] and the input base is 10, - * cutoff will be set to 214748364 and cutlim to either - * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated - * a value > 214748364, or equal but the next digit is > 7 (or 8), - * the number is too big, and we will return a range error. - * - * Set any if any `digits' consumed; make it negative to indicate - * overflow. - */ - cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; - cutlim = cutoff % (unsigned long)base; - cutoff /= (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) - { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else - { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) - { - acc = neg ? LONG_MIN : LONG_MAX; - } - else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = any ? (char *)((size_t)(s - 1)) : (char *)((size_t)nptr); - return acc; -} diff --git a/reactos/lib/sdk/libcntpr/string/strtoul.c b/reactos/lib/sdk/libcntpr/string/strtoul.c deleted file mode 100644 index e777b09978c..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strtoul.c +++ /dev/null @@ -1,75 +0,0 @@ -#include -#include -#include -#include -#include - -/* - * Convert a string to an unsigned long integer. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - * - * @implemented - */ -unsigned long -strtoul(const char *nptr, char **endptr, int base) -{ - const char *s = nptr; - unsigned long acc; - int c; - unsigned long cutoff; - int neg = 0, any, cutlim; - - /* - * See strtol for comments as to the logic used. - */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') - { - neg = 1; - c = *s++; - } - else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) - { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; - cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) - { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) - { - acc = ULONG_MAX; - } - else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = any ? (char *)((size_t)(s - 1)) : (char *)((size_t)nptr); - return acc; -} diff --git a/reactos/lib/sdk/libcntpr/string/strtoull.c b/reactos/lib/sdk/libcntpr/string/strtoull.c deleted file mode 100644 index 07470204f88..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strtoull.c +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned long long -strtoull(const char *nptr, char **endptr, int base) -{ - const char *s = nptr; - unsigned long long acc; - int c; - unsigned long long cutoff; - int neg = 0, any, cutlim; - - /* - * See strtol for comments as to the logic used. - */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') - { - neg = 1; - c = *s++; - } - else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) - { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - cutoff = (unsigned long long)ULLONG_MAX / (unsigned long long)base; - cutlim = (unsigned long long)ULLONG_MAX % (unsigned long long)base; - for (acc = 0, any = 0;; c = *s++) - { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) - { - acc = ULLONG_MAX; - } - else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = any ? (char *)((size_t)(s - 1)) : (char *)((size_t)nptr); - return acc; -} diff --git a/reactos/lib/sdk/libcntpr/string/strupr.c b/reactos/lib/sdk/libcntpr/string/strupr.c deleted file mode 100644 index 3825993e0eb..00000000000 --- a/reactos/lib/sdk/libcntpr/string/strupr.c +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - - -/* - * @implemented - */ -char *_strupr(char *x) -{ - char *y=x; - - while (*y) { - *y=toupper(*y); - y++; - } - return x; -} diff --git a/reactos/lib/sdk/libcntpr/string/tcscat.h b/reactos/lib/sdk/libcntpr/string/tcscat.h deleted file mode 100644 index 72a17f7b8e6..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcscat.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $Id$ - */ - -#include - -_TCHAR * _tcscat(_TCHAR * s, const _TCHAR * append) -{ - _TCHAR * save = s; - - for(; *s; ++s); - - while((*s++ = *append++)); - - return save; -} - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/tcschr.h b/reactos/lib/sdk/libcntpr/string/tcschr.h deleted file mode 100644 index 8c5e1ff6448..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcschr.h +++ /dev/null @@ -1,22 +0,0 @@ -/* $Id$ - */ - -#include - -_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 */ diff --git a/reactos/lib/sdk/libcntpr/string/tcscmp.h b/reactos/lib/sdk/libcntpr/string/tcscmp.h deleted file mode 100644 index f94af94d2b0..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcscmp.h +++ /dev/null @@ -1,19 +0,0 @@ -/* $Id$ - */ - -#include - -int _tcscmp(const _TCHAR* s1, const _TCHAR* s2) -{ - while(*s1 == *s2) - { - if(*s1 == 0) return 0; - - s1 ++; - s2 ++; - } - - return *s1 - *s2; -} - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/tcscpy.h b/reactos/lib/sdk/libcntpr/string/tcscpy.h deleted file mode 100644 index ae2855710a0..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcscpy.h +++ /dev/null @@ -1,13 +0,0 @@ -/* $Id$ - */ - -#include - -_TCHAR * _tcscpy(_TCHAR * to, const _TCHAR * from) -{ - _TCHAR *save = to; - - for (; (*to = *from); ++from, ++to); - - return save; -} diff --git a/reactos/lib/sdk/libcntpr/string/tcslen.h b/reactos/lib/sdk/libcntpr/string/tcslen.h deleted file mode 100644 index 918fc0626d7..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcslen.h +++ /dev/null @@ -1,18 +0,0 @@ -/* $Id$ - */ - -#include -#include - -size_t _tcslen(const _TCHAR * str) -{ - const _TCHAR * s; - - if(str == 0) return 0; - - for(s = str; *s; ++ s); - - return s - str; -} - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/tcsncat.h b/reactos/lib/sdk/libcntpr/string/tcsncat.h deleted file mode 100644 index 146de33e8f8..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcsncat.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - */ - -#include -#include - -_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 */ diff --git a/reactos/lib/sdk/libcntpr/string/tcsncmp.h b/reactos/lib/sdk/libcntpr/string/tcsncmp.h deleted file mode 100644 index 420dc22ec1d..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcsncmp.h +++ /dev/null @@ -1,21 +0,0 @@ -/* $Id$ - */ - -#include -#include - -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/tcsncpy.h b/reactos/lib/sdk/libcntpr/string/tcsncpy.h deleted file mode 100644 index c8f9ab47dd0..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcsncpy.h +++ /dev/null @@ -1,28 +0,0 @@ -/* $Id$ - */ - -#include -#include - -_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 */ diff --git a/reactos/lib/sdk/libcntpr/string/tcsnlen.h b/reactos/lib/sdk/libcntpr/string/tcsnlen.h deleted file mode 100644 index 341678bd975..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcsnlen.h +++ /dev/null @@ -1,18 +0,0 @@ -/* $Id$ - */ - -#include -#include - -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 */ diff --git a/reactos/lib/sdk/libcntpr/string/tcsrchr.h b/reactos/lib/sdk/libcntpr/string/tcsrchr.h deleted file mode 100644 index 354003273db..00000000000 --- a/reactos/lib/sdk/libcntpr/string/tcsrchr.h +++ /dev/null @@ -1,22 +0,0 @@ -/* $Id$ - */ - -#include - -_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 */ diff --git a/reactos/lib/sdk/libcntpr/string/wcscat.c b/reactos/lib/sdk/libcntpr/string/wcscat.c deleted file mode 100644 index adf0e1c7919..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcscat.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcscat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcschr.c b/reactos/lib/sdk/libcntpr/string/wcschr.c deleted file mode 100644 index 20c852aaad9..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcschr.c +++ /dev/null @@ -1,9 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#define _XINT wchar_t -#include -#include "tcschr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcscmp.c b/reactos/lib/sdk/libcntpr/string/wcscmp.c deleted file mode 100644 index dc2ca0d9d34..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcscmp.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcscmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcscpy.c b/reactos/lib/sdk/libcntpr/string/wcscpy.c deleted file mode 100644 index 283d6ab6eb8..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcscpy.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcscpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcslen.c b/reactos/lib/sdk/libcntpr/string/wcslen.c deleted file mode 100644 index 768c52afd7b..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcslen.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcslen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcsncat.c b/reactos/lib/sdk/libcntpr/string/wcsncat.c deleted file mode 100644 index c2ec3af009a..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsncat.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcsncat.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcsncmp.c b/reactos/lib/sdk/libcntpr/string/wcsncmp.c deleted file mode 100644 index 13059cc957f..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsncmp.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcsncmp.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcsncpy.c b/reactos/lib/sdk/libcntpr/string/wcsncpy.c deleted file mode 100644 index 90a93ab24dd..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsncpy.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcsncpy.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcsnlen.c b/reactos/lib/sdk/libcntpr/string/wcsnlen.c deleted file mode 100644 index 445a4aab299..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsnlen.c +++ /dev/null @@ -1,8 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#include -#include "tcsnlen.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcsnset.c b/reactos/lib/sdk/libcntpr/string/wcsnset.c deleted file mode 100644 index 6f07495162c..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsnset.c +++ /dev/null @@ -1,17 +0,0 @@ -#include - -/* - * @implemented - */ -wchar_t *_wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill) -{ - wchar_t *t = wsToFill; - int i = 0; - while( *wsToFill != 0 && i < (int) sizeMaxFill) - { - *wsToFill = wcFill; - wsToFill++; - i++; - } - return t; -} diff --git a/reactos/lib/sdk/libcntpr/string/wcsrchr.c b/reactos/lib/sdk/libcntpr/string/wcsrchr.c deleted file mode 100644 index 0bd83205150..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsrchr.c +++ /dev/null @@ -1,9 +0,0 @@ -/* $Id$ - */ - -#define _UNICODE -#define _XINT wchar_t -#include -#include "tcsrchr.h" - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcsrev.c b/reactos/lib/sdk/libcntpr/string/wcsrev.c deleted file mode 100644 index 4f76eedebe7..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcsrev.c +++ /dev/null @@ -1,22 +0,0 @@ -#include - -/* - * @implemented - */ -wchar_t *_wcsrev(wchar_t *s) -{ - wchar_t *e; - wchar_t a; - e=s; - while (*e) - e++; - while (s -#include -#include - -/* - * @implemented - */ -long -wcstol(const wchar_t *nptr, wchar_t **endptr, int base) -{ - const wchar_t *s = nptr; - unsigned long acc; - int c; - unsigned long cutoff; - int neg = 0, any, cutlim; - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - do { - c = *s++; - } while (iswctype(c, _SPACE)); - if (c == '-') - { - neg = 1; - c = *s++; - } - else if (c == L'+') - c = *s++; - if ((base == 0 || base == 16) && - c == L'0' && (*s == L'x' || *s == L'X')) - { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == L'0' ? 8 : 10; - - /* - * Compute the cutoff value between legal numbers and illegal - * numbers. That is the largest legal value, divided by the - * base. An input number that is greater than this value, if - * followed by a legal input character, is too big. One that - * is equal to this value may be valid or not; the limit - * between valid and invalid numbers is then based on the last - * digit. For instance, if the range for longs is - * [-2147483648..2147483647] and the input base is 10, - * cutoff will be set to 214748364 and cutlim to either - * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated - * a value > 214748364, or equal but the next digit is > 7 (or 8), - * the number is too big, and we will return a range error. - * - * Set any if any `digits' consumed; make it negative to indicate - * overflow. - */ - cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; - cutlim = cutoff % (unsigned long)base; - cutoff /= (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) - { - if (iswctype(c, _DIGIT)) - c -= L'0'; - else if (iswctype(c, _ALPHA)) - c -= iswctype(c, _UPPER) ? L'A' - 10 : L'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else - { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) - { - acc = neg ? LONG_MIN : LONG_MAX; - } - else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = any ? (wchar_t *)((size_t)(s - 1)) : (wchar_t *)((size_t)nptr); - return acc; -} diff --git a/reactos/lib/sdk/libcntpr/string/wcstombs.c b/reactos/lib/sdk/libcntpr/string/wcstombs.c deleted file mode 100644 index d927b7e9681..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcstombs.c +++ /dev/null @@ -1,59 +0,0 @@ -#define WIN32_NO_STATUS -#include -#include -#include - -/* - * @implemented - */ -int wctomb (char *mbchar, wchar_t wchar) -{ - NTSTATUS Status; - ULONG Size; - - if (mbchar == NULL) - return 0; - - Status = RtlUnicodeToMultiByteN (mbchar, - 1, - &Size, - &wchar, - sizeof(WCHAR)); - if (!NT_SUCCESS(Status)) - return -1; - - return (int)Size; -} - -/* - * @implemented - */ -size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count) -{ - NTSTATUS Status; - ULONG Size; - ULONG Length; - - Length = wcslen (wcstr); - - if (mbstr == NULL) - { - RtlUnicodeToMultiByteSize (&Size, - (wchar_t*)((size_t)wcstr), - Length * sizeof(WCHAR)); - - return (size_t)Size; - } - - Status = RtlUnicodeToMultiByteN (mbstr, - count, - &Size, - (wchar_t*)((size_t)wcstr), - Length * sizeof(WCHAR)); - if (!NT_SUCCESS(Status)) - return -1; - - return (size_t)Size; -} - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wcstoul.c b/reactos/lib/sdk/libcntpr/string/wcstoul.c deleted file mode 100644 index 07b2258a34b..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wcstoul.c +++ /dev/null @@ -1,74 +0,0 @@ -#include -#include -#include - - -/* - * Convert a unicode string to an unsigned long integer. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - * - * @implemented - */ -unsigned long -wcstoul(const wchar_t *nptr, wchar_t **endptr, int base) -{ - const wchar_t *s = nptr; - unsigned long acc; - int c; - unsigned long cutoff; - int neg = 0, any, cutlim; - - /* - * See strtol for comments as to the logic used. - */ - do { - c = *s++; - } while (iswctype(c, _SPACE)); - if (c == '-') - { - neg = 1; - c = *s++; - } - else if (c == L'+') - c = *s++; - if ((base == 0 || base == 16) && - c == L'0' && (*s == L'x' || *s == L'X')) - { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == L'0' ? 8 : 10; - cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; - cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) - { - if (iswctype(c, _DIGIT)) - c -= L'0'; - else if (iswctype(c, _ALPHA)) - c -= iswctype(c, _UPPER) ? L'A' - 10 : L'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) - { - acc = ULONG_MAX; - } - else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = any ? (wchar_t *)((size_t)s - 1) : (wchar_t *)((size_t)nptr); - return acc; -} diff --git a/reactos/lib/sdk/libcntpr/string/wstring.c b/reactos/lib/sdk/libcntpr/string/wstring.c deleted file mode 100644 index 758eedf0585..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wstring.c +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include - -/* FUNCTIONS *****************************************************************/ - -int _wcsicmp (const wchar_t* cs, const wchar_t * ct) -{ - while (towlower(*cs) == towlower(*ct)) - { - if (*cs == 0) - return 0; - cs++; - ct++; - } - return towlower(*cs) - towlower(*ct); -} - - -/* - * @implemented - */ -wchar_t *_wcslwr (wchar_t *x) -{ - wchar_t *y=x; - - while (*y) { - *y=towlower(*y); - y++; - } - return x; -} - - -/* - * @implemented - */ -int _wcsnicmp (const wchar_t * cs, const wchar_t * ct, size_t count) -{ - if (count == 0) - return 0; - do { - if (towupper(*cs) != towupper(*ct++)) - return towupper(*cs) - towupper(*--ct); - if (*cs++ == 0) - break; - } while (--count != 0); - return 0; -} - - -/* - * @implemented - */ -wchar_t *_wcsupr(wchar_t *x) -{ - wchar_t *y=x; - - while (*y) { - *y=towupper(*y); - y++; - } - return x; -} - -/* - * @implemented - */ -size_t wcscspn(const wchar_t *str,const wchar_t *reject) -{ - const wchar_t *t; - const wchar_t *s = str; - do { - t=reject; - while (*t) { - if (*t==*s) - break; - t++; - } - if (*t) - break; - s++; - } while (*s); - return s-str; /* nr of wchars */ -} - -/* - * @implemented - */ -wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2) -{ - const wchar_t *scanp; - int c, sc; - - while ((c = *s1++) != 0) - { - for (scanp = s2; (sc = *scanp++) != 0;) - if (sc == c) - { - return (wchar_t *)((size_t)(--s1)); - } - } - return 0; -} - -/* - * @implemented - */ -size_t wcsspn(const wchar_t *str,const wchar_t *accept) -{ - const wchar_t *t; - const wchar_t *s = str; - do { - t=accept; - while (*t) { - if (*t==*s) - break; - t++; - } - if (!*t) - break; - s++; - } while (*s); - return s-str; /* nr of wchars */ -} - - -/* - * @implemented - */ -wchar_t *wcsstr(const wchar_t *s,const wchar_t *b) -{ - const wchar_t *y; - const wchar_t *c; - const wchar_t *x = s; - while (*x) { - if (*x==*b) { - y=x; - c=b; - while (*y && *c && *y==*c) { - c++; - y++; - } - if (!*c) - return (wchar_t *)((size_t)x); - } - x++; - } - return NULL; -} - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wtoi.c b/reactos/lib/sdk/libcntpr/string/wtoi.c deleted file mode 100644 index fba564c713c..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wtoi.c +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - -/* - * @implemented - * copy _i64toa from wine cvs 2006 month 05 day 21 - */ -int -_wtoi(const wchar_t *str) -{ - return _wtol(str); -} diff --git a/reactos/lib/sdk/libcntpr/string/wtoi64.c b/reactos/lib/sdk/libcntpr/string/wtoi64.c deleted file mode 100644 index 11f4fe567df..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wtoi64.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -/* - * @implemented - */ -__int64 -_wtoi64 (const wchar_t *nptr) -{ - int c; - __int64 value; - int sign; - - while (iswctype((int)*nptr, _SPACE)) - ++nptr; - - c = (int)*nptr++; - sign = c; - if (c == L'-' || c == L'+') - c = (int)*nptr++; - - value = 0; - - while (iswctype(c, _DIGIT)) - { - value = 10 * value + (c - L'0'); - c = (int)*nptr++; - } - - if (sign == L'-') - return -value; - else - return value; -} - -/* EOF */ diff --git a/reactos/lib/sdk/libcntpr/string/wtol.c b/reactos/lib/sdk/libcntpr/string/wtol.c deleted file mode 100644 index 9944956384b..00000000000 --- a/reactos/lib/sdk/libcntpr/string/wtol.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include - -/* Implementation comes from wine/dlls/ntdll/wcstring.c */ - -/* - * @implemented - */ -long -_wtol(const wchar_t *str) -{ - unsigned long RunningTotal = 0; - char bMinus = 0; - - while (iswctype(*str, _SPACE) ) { - str++; - } /* while */ - - if (*str == L'+') { - str++; - } else if (*str == L'-') { - bMinus = 1; - str++; - } /* if */ - - while (*str >= L'0' && *str <= L'9') { - RunningTotal = RunningTotal * 10 + *str - L'0'; - str++; - } /* while */ - - return bMinus ? -RunningTotal : RunningTotal; -} - - diff --git a/reactos/lib/sdk/sdk.rbuild b/reactos/lib/sdk/sdk.rbuild index 4c4795d20b8..d8ef77c6c4d 100644 --- a/reactos/lib/sdk/sdk.rbuild +++ b/reactos/lib/sdk/sdk.rbuild @@ -3,13 +3,11 @@ + - - -