1fd6bab5484e30e2f6808d4bc5c3e603af26a1b3
[reactos.git] / freeldr / freeldr / rtl.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1999, 2000, 2001 Brian Palmer <brianp@sginet.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __STDLIB_H
21 #define __STDLIB_H
22
23 #include <freeldr.h>
24
25 ///////////////////////////////////////////////////////////////////////////////////////
26 //
27 // String Functions
28 //
29 ///////////////////////////////////////////////////////////////////////////////////////
30 int strlen(char *str);
31 char * strcpy(char *dest, char *src);
32 char * strncpy(char *dest, char *src, size_t count);
33 char * strcat(char *dest, char *src);
34 char * strchr(const char *s, int c);
35 char * strrchr(const char *s, int c);
36 int strcmp(const char *string1, const char *string2);
37 int stricmp(const char *string1, const char *string2);
38 int strncmp(const char *string1, const char *string2, size_t length);
39 int _strnicmp(const char *string1, const char *string2, size_t length);
40
41 ///////////////////////////////////////////////////////////////////////////////////////
42 //
43 // Memory Functions
44 //
45 ///////////////////////////////////////////////////////////////////////////////////////
46 int RtlCompareMemory(const PVOID Source1, const PVOID Source2, ULONG Length);
47 VOID RtlCopyMemory(PVOID Destination, const PVOID Source, ULONG Length);
48 VOID RtlFillMemory(PVOID Destination, ULONG Length, UCHAR Fill);
49 VOID RtlZeroMemory(PVOID Destination, ULONG Length);
50
51 #define memcmp(buf1, buf2, count) RtlCompareMemory(buf1, buf2, count)
52 #define memcpy(dest, src, count) RtlCopyMemory(dest, src,count)
53 #define memset(dest, c, count) RtlFillMemory(dest,count, c)
54
55 ///////////////////////////////////////////////////////////////////////////////////////
56 //
57 // Standard Library Functions
58 //
59 ///////////////////////////////////////////////////////////////////////////////////////
60 int atoi(char *string);
61 char * itoa(int value, char *string, int radix);
62 int toupper(int c);
63 int tolower(int c);
64
65 int isspace(int c);
66 int isdigit(int c);
67 int isxdigit(int c);
68
69 char * convert_to_ascii(char *buf, int c, ...);
70
71 void putchar(int ch); // Implemented in asmcode.S
72 void clrscr(void); // Implemented in asmcode.S
73 int kbhit(void); // Implemented in asmcode.S
74 int getch(void); // Implemented in asmcode.S
75 void gotoxy(int x, int y); // Implemented in asmcode.S
76 int getyear(void); // Implemented in asmcode.S
77 int getday(void); // Implemented in asmcode.S
78 int getmonth(void); // Implemented in asmcode.S
79 int gethour(void); // Implemented in asmcode.S
80 int getminute(void); // Implemented in asmcode.S
81 int getsecond(void); // Implemented in asmcode.S
82 void hidecursor(void); // Implemented in asmcode.S
83 void showcursor(void); // Implemented in asmcode.S
84 int wherex(void); // Implemented in asmcode.S
85 int wherey(void); // Implemented in asmcode.S
86
87 ///////////////////////////////////////////////////////////////////////////////////////
88 //
89 // Screen Output Functions
90 //
91 ///////////////////////////////////////////////////////////////////////////////////////
92 void print(char *str);
93 void printf(char *fmt, ...);
94 void sprintf(char *buffer, char *format, ...);
95
96
97 #ifndef max
98 #define max(a, b) (((a) > (b)) ? (a) : (b))
99 #endif
100
101 #ifndef min
102 #define min(a, b) (((a) < (b)) ? (a) : (b))
103 #endif
104
105
106 #endif // defined __STDLIB_H