1. 11 Apr, 2018 2 commits
    • Laslo Hunhold's avatar
      Add warn() and die() · d9c382a9
      Laslo Hunhold authored
      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
    • Laslo Hunhold's avatar
      Add efread() and efwrite() · 02b05163
      Laslo Hunhold authored
      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.
  2. 02 Aug, 2017 1 commit
    • Laslo Hunhold's avatar
      Combine all license matters in LICENSE · 9e0a561d
      Laslo Hunhold authored
      We use some OpenBSD code in util.c (namely by Ted Unangst, Todd C.
      Miller and Otto Moerbeek), which is licensed under the ISC license.
      To make it clearer and make it easier to see what farbfeld really is licensed
      under, we include these authors in the LICENSE file and remove the
      explicit headers from util.c. While at it, we also remove superfluous
      includes and shove them to the top.
  3. 14 Apr, 2017 1 commit
    • Laslo Hunhold's avatar
      Remove the need of '#' for alpha masks · 4aa840bd
      Laslo Hunhold authored
      To be honest, it can happen too easily that the user forgets to put
      the colour in quotation marks, yielding in the rest of the
      pipeline to be discarded as a comment.
  4. 12 Apr, 2017 2 commits
    • Laslo Hunhold's avatar
      Use fshut() to properly flush the output stream · 17f09e2c
      Laslo Hunhold authored
      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
    • Laslo Hunhold's avatar
      Rename header-functions and add more util functions · aa873108
      Laslo Hunhold authored
      	parse_mask() -> parse a mask-color #xxxxxx
      These will come in handy in the respective tools.
  5. 30 Mar, 2017 1 commit