aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/mediatek/MZ_FT5346/self-test/ini.h
blob: e2514aa2d5899e95828c4aad3c2f0c1342818f8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef INI_H
#define INI_H

#define MAX_CFG_BUF       512
#define SUCCESS				0
/* return value */
#define CFG_OK						  SUCCESS
#define CFG_SECTION_NOT_FOUND         -1 
#define CFG_KEY_NOT_FOUND             -2 
#define CFG_ERR                       -10 

#define CFG_ERR_OPEN_FILE             -10 
#define CFG_ERR_CREATE_FILE           -11 
#define CFG_ERR_READ_FILE             -12 
#define CFG_ERR_WRITE_FILE            -13 
#define CFG_ERR_FILE_FORMAT           -14 

#define CFG_ERR_EXCEED_BUF_SIZE       -22 

#define COPYF_OK                      SUCCESS 
#define COPYF_ERR_OPEN_FILE           -10 
#define COPYF_ERR_CREATE_FILE         -11 
#define COPYF_ERR_READ_FILE           -12 
#define COPYF_ERR_WRITE_FILE          -13 

#define FOCAL_DBG
#ifdef FOCAL_DBG
#define FTS_DBG(fmt, args...) printk("[FTS]" fmt, ## args)
#else
#define FTS_DBG(fmt, args...) do{}while(0)
#endif

struct ini_key_location {
	int ini_section_line_no;
	int ini_key_line_no;
	int ini_key_lines;
};

int ini_get_key(char *filedata, char * section, char * key, char * value);
int ini_get_sections(char *filedata, unsigned char * sections[], int max);

int  ini_split_section(char *section, char **name, char **index);
int atoi(char *nptr);
char * ini_str_trim_r(char * buf);
char * ini_str_trim_l(char * buf);

#endif