mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 10:41:07 +00:00
Removing exit calls from config parser
* config.h: cleanup, left only internally needed definitions * config.c: removed exit calls, use yyerror and yywarning * config_gram.y: (Dito.) * lexer.l: (Dito.) * libavrdude.h: removed internal definitions of config parser * main.c: removed yyerror, it is now in config.c * jtagmkII.c: added missing free in error case * pgm.c: replaced exits by returns * pickit2.c: add missing return git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1322 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
62
libavrdude.h
62
libavrdude.h
@@ -893,34 +893,6 @@ void walk_programmer_types(/*LISTID programmer_types,*/ walk_programmer_types_cb
|
||||
|
||||
/* formerly config.h */
|
||||
|
||||
#define MAX_STR_CONST 1024
|
||||
|
||||
enum { V_NONE, V_NUM, V_NUM_REAL, V_STR };
|
||||
typedef struct value_t {
|
||||
int type;
|
||||
/*union { TODO: use an anonymous union here ? */
|
||||
int number;
|
||||
double number_real;
|
||||
char * string;
|
||||
/*};*/
|
||||
} VALUE;
|
||||
|
||||
|
||||
typedef struct token_t {
|
||||
int primary;
|
||||
VALUE value;
|
||||
} TOKEN;
|
||||
typedef struct token_t *token_p;
|
||||
|
||||
|
||||
extern FILE * yyin;
|
||||
extern PROGRAMMER * current_prog;
|
||||
extern AVRPART * current_part;
|
||||
extern AVRMEM * current_mem;
|
||||
extern int lineno;
|
||||
extern const char * infile;
|
||||
extern LISTID string_list;
|
||||
extern LISTID number_list;
|
||||
extern LISTID part_list;
|
||||
extern LISTID programmers;
|
||||
extern char default_programmer[];
|
||||
@@ -933,48 +905,14 @@ extern int default_safemode;
|
||||
* default_parallel and default_serial. */
|
||||
#define DEFAULT_USB "usb"
|
||||
|
||||
|
||||
#if !defined(HAS_YYSTYPE)
|
||||
#define YYSTYPE token_p
|
||||
#endif
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
extern char string_buf[MAX_STR_CONST];
|
||||
extern char *string_buf_ptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int yyparse(void);
|
||||
|
||||
|
||||
int init_config(void);
|
||||
|
||||
void cleanup_config(void);
|
||||
|
||||
TOKEN * new_token(int primary);
|
||||
|
||||
void free_token(TOKEN * tkn);
|
||||
|
||||
void free_tokens(int n, ...);
|
||||
|
||||
TOKEN * number(char * text);
|
||||
|
||||
TOKEN * number_real(char * text);
|
||||
|
||||
TOKEN * hexnumber(char * text);
|
||||
|
||||
TOKEN * string(char * text);
|
||||
|
||||
TOKEN * keyword(int primary);
|
||||
|
||||
void print_token(TOKEN * tkn);
|
||||
|
||||
void pyytext(void);
|
||||
|
||||
char * dup_string(const char * str);
|
||||
|
||||
int read_config(const char * file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user