Subversion Repositories Kolibri OS

Rev

Rev 5399 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5399 Rev 5401
Line 1... Line 1...
1
//INI parser in C--, GPL licence.
1
//INI parser in C--, GPL licence.
2
//Leency - 2012
2
//Leency - 2012
Line 3... Line -...
3
 
-
 
4
#define COMMENT	0
-
 
5
#define SECTION	1
-
 
6
#define PARAM	2
-
 
7
#define OPTION	3
-
 
8
 
-
 
9
 
3
 
10
void GetIni(byte onload)
4
void GetIni(byte onload)
11
{
5
{
12
	byte section[32], parametr[32], option[256], InfType=0;
-
 
13
	char bukva[2];
-
 
14
	int errornum, tj;
-
 
15
	static dword buff, fsize;
-
 
16
	if (onload==1)
-
 
17
	{
-
 
18
		free(buff);
-
 
19
		if (!GetFile(#buff, #fsize, abspath("Eolite.ini"))) notify("Eolite.ini not found. Defaults will be used.");
-
 
20
	}
-
 
21
	
6
	dword eolite_ini_path = abspath("Eolite.ini"); 
22
	ini_get_color stdcall (abspath("Eolite.ini"), "Config", "SelectionColor", 0x94AECE);
7
	ini_get_color stdcall (eolite_ini_path, "Config", "SelectionColor", 0x94AECE);
-
 
8
	edit2.shift_color = EAX;
23
	edit2.shift_color = EAX;
9
	col_selec = EAX;
24
	ini_get_int stdcall (abspath("Eolite.ini"), "Config", "LineHeight", 18);
10
	ini_get_int stdcall (eolite_ini_path, "Config", "LineHeight", 18);
25
	files.line_h = EAX;
11
	files.line_h = EAX;
26
	ini_get_int stdcall (abspath("Eolite.ini"), "Config", "ShowDeviceName", 1);
12
	ini_get_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1);
27
	show_dev_name = EAX;
13
	show_dev_name = EAX;
28
	ini_get_int stdcall (abspath("Eolite.ini"), "Config", "RealFileNamesCase", 0);
14
	ini_get_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0);
29
	real_files_names_case = EAX;
-
 
30
	ini_get_int stdcall (abspath("Eolite.ini"), "Config", "DrwRamDiskSpace", 0);
-
 
31
	drw_ram_disk_space = EAX;
15
	real_files_names_case = EAX;
Line 32... Line 16...
32
}
16
}
33
 
17
 
Line 42... Line 26...
42
	ii = get_error(error_number);
26
	ii = get_error(error_number);
43
	strcat(#error_message, ii);
27
	strcat(#error_message, ii);
44
	strcat(#error_message, "\" -tE");
28
	strcat(#error_message, "\" -tE");
45
	notify(#error_message);
29
	notify(#error_message);
46
}
30
}
47
 
-
 
48
 
-
 
49
dword StrToCol(char* htmlcolor)
-
 
50
{
-
 
51
  dword j, color=0;
-
 
52
  char ch=0x00;
-
 
53
  
-
 
54
  FOR (j=0; j<6; j++)
-
 
55
  {
-
 
56
    ch=ESBYTE[htmlcolor+j];
-
 
57
    IF ((ch>='0') && (ch<='9')) ch -= '0';
-
 
58
    IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
-
 
59
    IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
-
 
60
    color = color*0x10 + ch;
-
 
61
  }
-
 
62
   return color;
-
 
63
}
-
 
64
31