Subversion Repositories Kolibri OS

Rev

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

Rev 984 Rev 1415
Line 1... Line 1...
1
//INI parser in C--, GPL licence.
1
//INI parser in C--, GPL licence.
2
//Copyright 2008 by Leency
2
//Leency - 2008
Line 3... Line 3...
3
 
3
 
4
#define COMMENT	0
4
#define COMMENT	0
5
#define SECTION	1
5
#define SECTION	1
6
#define PARAM	2
6
#define PARAM	2
Line 37... Line 37...
37
				break;
37
				break;
38
			case 0x0a:
38
			case 0x0a:
39
			case 0x0d:
39
			case 0x0d:
40
				InfType=PARAM;
40
				InfType=PARAM;
41
				//IF (strcmp(#parametr,"select_color")==0) videlenie=StrToCol(#option);
41
				//IF (strcmp(#parametr,"select_color")==0) videlenie=StrToCol(#option);
42
				IF (parametr) && (!strcmp(#file_name+find_symbol(#file_name,'.'),#parametr)) {RunProgram(#option,#file_path); return;}
42
				IF (parametr) && (!strcmp(#file_name+find_symbol(#file_name,'.'),#parametr)) {
-
 
43
					RunProgram(#option,#file_path);
-
 
44
					return;
-
 
45
				}
43
				parametr=option='';
46
				parametr=option='';
44
				break;
47
				break;
45
			default:
48
			default:
46
				IF (InfType==SECTION) copystr(#bukva,#section+strlen(#section));
49
				IF (InfType==SECTION) copystr(#bukva,#section+strlen(#section));
47
				IF (InfType==PARAM) copystr(#bukva,#parametr+strlen(#parametr));
50
				IF (InfType==PARAM) copystr(#bukva,#parametr+strlen(#parametr));
Line 49... Line 52...
49
		}
52
		}
50
	}
53
	}
51
	INI_END: 
54
	INI_END: 
52
	IF (file_path) RunProgram(#file_path,''); 
55
	IF (file_path) RunProgram(#file_path,''); 
53
}
56
}
54
 
-
 
55
 
-
 
56
/*inline fastcall void OpenFile(ESI)
-
 
57
{
-
 
58
	byte ext_n_progs="ext|tinypad|ext2|Eolite|"; //=ESI
-
 
59
	byte str;
-
 
60
	do{
-
 
61
		$lodsb
-
 
62
		IF(AL=='|') str='';
-
 
63
		copystr(ESBYTE[AL],str);
-
 
64
	} while(AL!=0);
-
 
65
	//RunProgram(fpath, #fparam); //çàïóñê!	
-
 
66
}*/
-