Exchange of fprintf(stderr, ...) with avrdude_message(...).

This change was made for the shared library, since library functions
should not write to std-streams directly. Instead avrdude_message()
has to be implemented by the library user. For the avrdude application
this function is implemented in main.c.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1305 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Axel Wachtler
2014-05-18 08:41:46 +00:00
parent 52dd5cc7ac
commit eb5fcb581f
45 changed files with 2380 additions and 2896 deletions

10
lexer.l
View File

@@ -95,9 +95,9 @@ SIGN [+-]
}
if (c == EOF) {
fprintf(stderr, "error at %s:%d: EOF in comment\n",
avrdude_message("error at %s:%d: EOF in comment\n",
infile, lineno);
fprintf(stderr, " comment started on line %d\n",
avrdude_message(" comment started on line %d\n",
comment_start);
exit(1);
break;
@@ -116,7 +116,7 @@ SIGN [+-]
<strng>\\(.|\n) *(string_buf_ptr++) = yytext[1];
<strng>[^\\\n\"]+ { char *yptr = yytext; while (*yptr)
*(string_buf_ptr++) = *(yptr++); }
<strng>\n { fprintf(stderr, "error at line %d: unterminated character constant\n",
<strng>\n { avrdude_message("error at line %d: unterminated character constant\n",
lineno);
exit(1); }
@@ -255,9 +255,9 @@ yes { yylval=new_token(K_YES); return K_YES; }
"\n" { lineno++; }
[ \r\t]+ { /* ignore whitespace */ }
c: { fprintf(stderr, "error at %s:%d: possible old-style config file entry\n",
c: { avrdude_message("error at %s:%d: possible old-style config file entry\n",
infile, lineno);
fprintf(stderr, " Update your config file (see %s%s for a sample)\n",
avrdude_message(" Update your config file (see %s%s for a sample)\n",
CONFIG_DIR, "/avrdude.conf.sample");
return YYERRCODE; }