1
0

more cleaning!!!

This commit is contained in:
dtb
2022-09-18 20:40:56 -04:00
parent 3b9ff7ddb4
commit 473cbc8123
8 changed files with 62 additions and 90 deletions

13
sysexits/Makefile Normal file
View File

@@ -0,0 +1,13 @@
TARGETS = sysexits sysexits.h
CFLAGS = -I..
all: $(TARGETS)
clean:
rm -f $(TARGETS)
%: %.c
$(CC) $(CFLAGS) -o $@ $@.c
sysexits.h: sysexits
./sysexits >sysexits.h

View File

@@ -1,15 +1,14 @@
#include <ascii.h>
#include <stdio.h>
#include <unistd.h>
#include "usefulmacros.h"
#include "arraylen.h"
/* Thanks to u/smcameron on Reddit. */
#define TAB_WIDTH 8
/* Changing ENUM to DEFINE will make this output the traditional BSD header
* verbatim, without copyright notice. I don't have any fucking idea if that's
* a copyright violation, but let's keep this as ENUM to skirt by that little
* verbatim, without copyright notice. I don't have any idea if that's a
* copyright violation, but let's keep this as ENUM to skirt by that little
* technicality.
* I implemented sysexits(3) in the enum method before reading the BSD 4.0
* source to see how they did it. */
@@ -17,7 +16,7 @@
static char *program_name = "sysexits";
//static const char comment_prefix[] = "/* ";
static const char comment_prefix[] = "/* ";
static const char comment_prefix_ongoing[] = " * ";
static const char comment_suffix[] = " */\n";
@@ -168,7 +167,7 @@ static void output_header(void){
);
#endif /* ifdef DEFINE */
}
fflush(stdout); /* Fixes actual issue. */
fflush(stdout);
write(1, header_suffix, ARRAYLEN(header_suffix) - 1);
}