More runtime functions

svn path=/trunk/; revision=796
This commit is contained in:
Eric Kohl 1999-11-25 23:35:24 +00:00
parent 9b614b887d
commit 05a567fce3
4 changed files with 66 additions and 16 deletions

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.27 1999/11/24 11:51:46 dwelch Exp $ ; $Id: ntoskrnl.def,v 1.28 1999/11/25 23:35:24 ekohl Exp $
; ;
; reactos/ntoskrnl/ntoskrnl.def ; reactos/ntoskrnl/ntoskrnl.def
; ;
@ -247,6 +247,10 @@ RtlUpcaseUnicodeToOemN@20
RtlUpperChar@4 RtlUpperChar@4
RtlUpperString@8 RtlUpperString@8
RtlZeroMemory@8 RtlZeroMemory@8
RtlxAnsiStringToUnicodeSize@4
RtlxOemStringToUnicodeSize@4
RtlxUnicodeStringToAnsiSize@4
RtlxUnicodeStringToOemSize@4
ZwAccessCheckAndAuditAlarm@44 ZwAccessCheckAndAuditAlarm@44
ZwAlertThread@4 ZwAlertThread@4
ZwAllocateVirtualMemory@24 ZwAllocateVirtualMemory@24
@ -336,7 +340,7 @@ ZwYieldExecution@0
;_aullshr ;_aullshr
;_except_handler2 ;_except_handler2
;_global_unwind2 ;_global_unwind2
;_itoa _itoa
;_local_unwind2 ;_local_unwind2
;_purecall ;_purecall
;_snprintf ;_snprintf

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.14 1999/11/24 11:51:46 dwelch Exp $ ; $Id: ntoskrnl.edf,v 1.15 1999/11/25 23:35:24 ekohl Exp $
; ;
; reactos/ntoskrnl/ntoskrnl.def ; reactos/ntoskrnl/ntoskrnl.def
; ;
@ -245,6 +245,10 @@ RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
RtlUpperChar=RtlUpperChar@4 RtlUpperChar=RtlUpperChar@4
RtlUpperString=RtlUpperString@8 RtlUpperString=RtlUpperString@8
RtlZeroMemory=RtlZeroMemory@8 RtlZeroMemory=RtlZeroMemory@8
RtlxAnsiStringToUnicodeSize=RtlxAnsiStringToUnicodeSize@4
RtlxOemStringToUnicodeSize=RtlxOemStringToUnicodeSize@4
RtlxUnicodeStringToAnsiSize=RtlxUnicodeStringToAnsiSize@4
RtlxUnicodeStringToOemSize=RtlxUnicodeStringToOemSize@4
ZwAccessCheckAndAuditAlarm=ZwAccessCheckAndAuditAlarm@44 ZwAccessCheckAndAuditAlarm=ZwAccessCheckAndAuditAlarm@44
ZwAlertThread=ZwAlertThread@4 ZwAlertThread=ZwAlertThread@4
ZwAllocateVirtualMemory=ZwAllocateVirtualMemory@24 ZwAllocateVirtualMemory=ZwAllocateVirtualMemory@24
@ -334,7 +338,7 @@ ZwYieldExecution=ZwYieldExecution@0
;_aullshr ;_aullshr
;_except_handler2 ;_except_handler2
;_global_unwind2 ;_global_unwind2
;_itoa _itoa
;_local_unwind2 ;_local_unwind2
;_purecall ;_purecall
;_snprintf ;_snprintf

View file

@ -22,37 +22,38 @@ static unsigned long long next = 0;
#if 0 #if 0
int atoi(const char *str) int atoi(const char *str)
{ {
return (int)strtol(str, 0, 10); return (int)atol (str);
} }
long atol(const char *str) long atol(const char *str)
{ {
return strtol(str, 0, 10); return strtol(str, 0, 10);
} }
#endif
char *_itoa(int value, char *string, int radix)
/*
* NOTE: no radix range check (valid range: 2 - 36)
*/
char *_itoa (int value, char *string, int radix)
{ {
char tmp[33]; char tmp[33];
char *tp = tmp; char *tp = tmp;
int i; int i;
unsigned v; unsigned v;
int sign; int sign;
char *sp; char *sp = NULL;
if (string == 0) if (string == NULL)
return NULL; return NULL;
if (radix > 36 || radix <= 1)
{
__set_errno(EDOM);
return 0;
}
sign = (radix == 10 && value < 0); sign = (radix == 10 && value < 0);
if (sign) if (sign)
v = -value; v = -value;
else else
v = (unsigned)value; v = (unsigned)value;
while (v || tp == tmp) while (v || tp == tmp)
{ {
i = v % radix; i = v % radix;
@ -65,12 +66,13 @@ char *_itoa(int value, char *string, int radix)
if (sign) if (sign)
*sp++ = '-'; *sp++ = '-';
while (tp > tmp) while (tp > tmp)
*sp++ = *--tp; *sp++ = *--tp;
*sp = 0; *sp = 0;
return string; return string;
} }
#endif
int rand(void) int rand(void)

View file

@ -1,4 +1,4 @@
/* $Id: unicode.c,v 1.9 1999/11/20 21:45:20 ekohl Exp $ /* $Id: unicode.c,v 1.10 1999/11/25 23:34:43 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -1341,4 +1341,44 @@ RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
DestinationString->Length = SourceString->Length; DestinationString->Length = SourceString->Length;
} }
ULONG
STDCALL
RtlxAnsiStringToUnicodeSize (
IN PANSI_STRING AnsiString
)
{
return RtlAnsiStringToUnicodeSize (AnsiString);
}
ULONG
STDCALL
RtlxOemStringToUnicodeSize (
IN POEM_STRING OemString
)
{
return RtlAnsiStringToUnicodeSize ((PANSI_STRING)OemString);
}
ULONG
STDCALL
RtlxUnicodeStringToAnsiSize (
IN PUNICODE_STRING UnicodeString
)
{
return RtlUnicodeStringToAnsiSize (UnicodeString);
}
ULONG
STDCALL
RtlxUnicodeStringToOemSize (
IN PUNICODE_STRING UnicodeString
)
{
return RtlUnicodeStringToAnsiSize (UnicodeString);
}
/* EOF */ /* EOF */