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

View File

@@ -91,7 +91,7 @@ void ppi_open(char *port, union filedescriptor *fdp)
if(fd < 0)
{
fprintf(stderr, "%s: can't open device \"giveio\"\n\n", progname);
avrdude_message("%s: can't open device \"giveio\"\n\n", progname);
fdp->ifd = -1;
return;
}
@@ -119,15 +119,14 @@ void ppi_open(char *port, union filedescriptor *fdp)
fd = strtol(port, &cp, 0);
if(*port == '\0' || *cp != '\0')
{
fprintf(stderr,
"%s: port name \"%s\" is neither lpt1/2/3 nor valid number\n",
progname, port);
avrdude_message("%s: port name \"%s\" is neither lpt1/2/3 nor valid number\n",
progname, port);
fd = -1;
}
}
if(fd < 0)
{
fprintf(stderr, "%s: can't open device \"%s\"\n\n", progname, port);
avrdude_message("%s: can't open device \"%s\"\n\n", progname, port);
fdp->ifd = -1;
return;
}
@@ -361,7 +360,7 @@ int gettimeofday(struct timeval *tv, struct timezone *unused){
unsigned long dt; \
dt = (unsigned long)((stop.QuadPart - start.QuadPart) * 1000 * 1000 \
/ freq.QuadPart); \
fprintf(stderr, \
avrdude_message(\
"hpt:%i usleep usec:%lu sleep msec:%lu timed usec:%lu\n", \
has_highperf, us, ((us + 999) / 1000), dt); \
} while (0)