summaryrefslogtreecommitdiff
path: root/ff2pam.c
AgeCommit message (Collapse)Author
2018-04-11Add warn() and die()Laslo Hunhold
To fully centralize this matter these well-tested functions are added to the util.c, and implemented as we know it from many other suckless projects.
2018-04-11Add efread() and efwrite()Laslo Hunhold
Given we have a util.c anyway it does not make any sense to duplicate code here. This way, error handling and output is in one place and one does not have to change things in multiple different files. This also reduces code duplication by a lot. It also solves an older bug where the error reporting was not on point: $ echo "farb" | ff2png ff2png: fread: Success (It also lacked a newline) Now it properly reports $ echo "farb" | ff2png ff2png: fread: Unexpected end of file I also fixed some other minor details, for instance that all error messages should begin with a capital letter.
2017-04-13Use fshut() to properly flush the output streamLaslo Hunhold
For small images, it could happen that the output stream would not be flushed before exit(), resulting in a lack of error-reporting on a full device. Using fflush(), a function I first introduced in sbase, we do the flushing before returning manually and report errors if they occurred.
2017-04-12Refactor ff2pam(1)Laslo Hunhold
I chose to go with a row-based-approach here, which is a bit easier to read and is somewhat "closer" to the input data.
2017-03-30Add util.{c|h} to deduplicate codeLaslo Hunhold
2017-01-09Add ff2pam(1): convert farbfeld to 16-bit RGBA Portable Arbitrary MapMattias Andrée
Laslo: Minor changes Signed-off-by: Mattias Andrée <maandree@kth.se>