Hi.
In general, programming under POSIX, I can get information
about
errors by reading errno:
if (read(fd, buf, len) == -1)
switch (errno) {
case EIO: handle_io_error(); break;
case EAGAIN:
case EWOULDBLOCK:
printf("waiting...n");
break;
default:
break;
}
With libpng, of course I can set my own error handlers, but
how can I get more information about exactly what error
occurred? Currently, I'm checking errno inside my custom
IO functions, but what about, for example, when a file
turns out not to be a PNG file? Of course I could check
that
the error string is 'Not a PNG file' inside an error
handler,
but this seems messy. I'd much rather do something like:
if (png->errno == LIBPNG_ERROR_NOTPNG)
handle_invalid_png();
Is this possible, currently?
thanks,
MC
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
png-mng-implement mailing list
png-mng-implement lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/png-m
ng-implement
|