Initial revision
[reactos.git] / freeldr / freeldr / stdlib.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1999, 2000 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 "fs.h"
24
25 void putchar(int ch); // Implemented in asmcode.S
26 void clrscr(void); // Implemented in asmcode.S
27 int kbhit(void); // Implemented in asmcode.S
28 int getch(void); // Implemented in asmcode.S
29 void gotoxy(int x, int y); // Implemented in asmcode.S
30 int getyear(void); // Implemented in asmcode.S
31 int getday(void); // Implemented in asmcode.S
32 int getmonth(void); // Implemented in asmcode.S
33 int gethour(void); // Implemented in asmcode.S
34 int getminute(void); // Implemented in asmcode.S
35 int getsecond(void); // Implemented in asmcode.S
36 void hidecursor(void); // Implemented in asmcode.S
37 void showcursor(void); // Implemented in asmcode.S
38 int wherex(void); // Implemented in asmcode.S
39 int wherey(void); // Implemented in asmcode.S
40
41 int strlen(char *str);
42 char *strcpy(char *dest, char *src);
43 char *strncpy(char *dest, char *src, size_t count);
44 char *strcat(char *dest, char *src);
45 char *strchr(const char *s, int c);
46 char *strrchr(const char *s, int c);
47 int strcmp(const char *string1, const char *string2);
48 int stricmp(const char *string1, const char *string2);
49 int strncmp(const char *string1, const char *string2, size_t length);
50 int _strnicmp(const char *string1, const char *string2, size_t length);
51 char *itoa(int value, char *string, int radix);
52 int toupper(int c);
53 int tolower(int c);
54 int memcmp(const void *buf1, const void *buf2, size_t count);
55 void *memcpy(void *dest, const void *src, size_t count);
56 void *memset(void *dest, int c, size_t count);
57 char *fgets(char *string, int n, PFILE stream);
58 int atoi(char *string);
59
60 #define ZeroMemory(Destination, Length) memset(Destination, 0, Length)
61
62 int isspace(int c);
63 int isdigit(int c);
64 int isxdigit(int c);
65
66
67 void print(char *str);
68 void printf(char *fmt, ...);
69 void sprintf(char *buffer, char *format, ...);
70
71 char *convert_to_ascii(char *buf, int c, ...);
72
73 int biosdisk(int cmd, int drive, int head, int track, int sector, int nsects, void *buffer); // Implemented in asmcode.S
74
75 BOOL BiosInt13Read(ULONG Drive, ULONG Head, ULONG Track, ULONG Sector, ULONG SectorCount, PVOID Buffer); // Implemented in asmcode.S
76 BOOL BiosInt13ReadExtended(ULONG Drive, ULONG Sector, ULONG SectorCount, PVOID Buffer); // Implemented in asmcode.S
77 BOOL BiosInt13ExtensionsSupported(ULONG Drive);
78
79 void stop_floppy(void); // Implemented in asmcode.S
80 int get_heads(int drive); // Implemented in asmcode.S
81 int get_cylinders(int drive); // Implemented in asmcode.S
82 int get_sectors(int drive); // Implemented in asmcode.S
83
84 #ifndef max
85 #define max(a, b) (((a) > (b)) ? (a) : (b))
86 #endif
87
88 #ifndef min
89 #define min(a, b) (((a) < (b)) ? (a) : (b))
90 #endif
91
92
93 #endif // defined __STDLIB_H