Initial revision
[reactos.git] / freeldr / freeldr / freeldr.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 __FREELDR_H
21 #define __FREELDR_H
22
23
24 /* just some stuff */
25 #define VERSION "FreeLoader v0.8"
26 #define COPYRIGHT "Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>"
27
28 #define ROSLDR_MAJOR_VERSION 0
29 #define ROSLDR_MINOR_VERSION 8
30 #define ROSLDR_PATCH_VERSION 0
31
32 #define size_t unsigned int
33 #define BOOL int
34 #define NULL 0
35 #define TRUE 1
36 #define FALSE 0
37 #define BYTE unsigned char
38 #define WORD unsigned short
39 #define DWORD unsigned long
40 #define CHAR char
41 #define WCHAR unsigned short
42 #define LONG long
43 #define ULONG unsigned long
44 #define PULONG unsigned long *
45 #define PDWORD DWORD *
46 #define PWORD WORD *
47
48 #define OSTYPE_REACTOS 1
49 #define OSTYPE_LINUX 2
50 #define OSTYPE_BOOTSECTOR 3
51 #define OSTYPE_PARTITION 4
52 #define OSTYPE_DRIVE 5
53
54 typedef struct
55 {
56 char name[260];
57 int nOSType; // ReactOS or Linux or a bootsector, etc.
58 } OSTYPE;
59
60 extern unsigned int BootDrive; // BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc.
61 extern unsigned int BootPartition; // Boot Partition, 1-4
62 extern BOOL bTUILoaded; // Tells us if the user interface is loaded
63
64 extern char *pFreeldrIni; // Load address for freeldr.ini
65 extern char *pScreenBuffer; // Save address for screen contents
66 extern int nCursorXPos; // Cursor's X Position
67 extern int nCursorYPos; // Cursor's Y Position
68
69 extern OSTYPE OSList[16]; // The OS list
70 extern int nNumOS; // Number of OSes listed
71
72 extern int nTimeOut; // Time to wait for the user before booting
73
74 void BootMain(void);
75 BOOL ParseIniFile(void);
76 int GetNumSectionItems(char *section); // returns the number of items in a particular section (i.e. [FREELOADER])
77 BOOL ReadSectionSettingByNumber(char *section, int num, char *name, char *value); // Reads the num'th value from section
78 BOOL ReadSectionSettingByName(char *section, char *valuename, char *name, char *value); // Reads the value named name from section
79 BOOL IsValidSetting(char *setting, char *value);
80 void SetSetting(char *setting, char *value);
81
82 #endif // defined __FREELDR_H