mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-18 03:14:42 +00:00
Cache config_file components in AVRPART and PROGRAMMER structures
Some 90% of the space of AVRPART and some 50% of PROGRAMMER is occupied by a 4 kB array config_file[] that contains the configuration file name. In preparation of developer options that output a raw dump of the part descriptions, this commit changes the config_file components from a large array, which is duplicated in each part and programmer description, to a cached string for each config file allowing for smaller raw dumps. This commit also changes the config file name to its realpath(), eg, shortens unwarranted `/bin/../etc/` file name components. It also changes the global variable names `infile` and `fileno` to cfg_infile and cfg_fileno for an ever so slight improvement of code clarity.
This commit is contained in:
@@ -50,8 +50,8 @@ extern FILE * yyin;
|
||||
extern PROGRAMMER * current_prog;
|
||||
extern AVRPART * current_part;
|
||||
extern AVRMEM * current_mem;
|
||||
extern int lineno;
|
||||
extern const char * infile;
|
||||
extern int cfg_lineno;
|
||||
extern char * cfg_infile;
|
||||
extern LISTID string_list;
|
||||
extern LISTID number_list;
|
||||
extern bool is_alias; // current entry is alias
|
||||
@@ -97,6 +97,8 @@ void pyytext(void);
|
||||
|
||||
char * dup_string(const char * str);
|
||||
|
||||
char * cache_string(const char * file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user