13 * Reads size bytes into the destination buffer from filename.
16 bool slurp(const char *filename, char *destination, int size) {
19 if ((fd = open(filename, O_RDONLY)) == -1)
22 int n = read(fd, destination, size);
24 destination[n] = '\0';
31 * Skip the given character for exactly 'amount' times, returns
32 * a pointer to the first non-'character' character in 'input'.
35 char *skip_character(char *input, char character, int amount) {
37 size_t len = strlen(input);
40 for (walk = input; ((size_t)(walk - input) < len) && (blanks < amount); walk++)
41 if (*walk == character)
44 return (walk == input ? walk : walk-1);
48 * Write errormessage to statusbar and exit
51 void die(const char *fmt, ...) {
55 (void)vsnprintf(buffer, sizeof(buffer), fmt, ap);
58 fprintf(stderr, "%s", buffer);