more cleaning!!!
This commit is contained in:
13
sysexits/Makefile
Normal file
13
sysexits/Makefile
Normal 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
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user