Narthex

Modular dictionary generator
git clone git@git.mcdim.xyz:/var/www/git/Narthex.git
Log | Files | Refs | README | LICENSE

commit 7b7b03f541ee7848cc5bd91b68077209f283e1e7
parent 138ca762cdfc09b3b7f196854406ee691b5f94bf
Author: Michael Constantine Dimopoulos <mk@mcdim.xyz>
Date:   Wed, 11 Aug 2021 10:21:43 +0000

Updated ncom

Diffstat:
Mcom/ncom.c | 66+++++++++++++++++++++++++++++++++---------------------------------
1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/com/ncom.c b/com/ncom.c @@ -1,16 +1,10 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <ctype.h> - /* * ncom - Narthex combinator (?) * * By Michael Constantine Dimopoulos * https://mcdim.xyz <mk@mcdim.xyz> * License: GNU GPL v3 - * + * * ncom iterates over stdin and after * printing the dictionary as is, it will * print it again but will also append @@ -28,9 +22,41 @@ * */ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <ctype.h> + #define VERSION "v1.0" #define BUFFER_SIZE 256 +static void +help(char * exename) +{ + printf( "ncom - Narthex combinator %s\n" + "By Michael C. Dim. <mk@mcdim.xyz>\n\n" + + "-d Use dot separator\n" + "-u Use underscore separator\n" + "-m Use hyphen separator\n" + "-n Exclude numerical bases\n" + "-b Exclude base-appended\n" + "-h Print this panel & exit\n" + "-v Print current version & exit\n\n" + + "Usage: cat [FILENAME] | %s [OPTIONS]\n", + VERSION, exename); + exit(EXIT_SUCCESS); +} + +static void +die(char * str) +{ + printf("%s\n", str); + exit(EXIT_SUCCESS); +} + static FILE * save_stdin(FILE *f) { @@ -84,32 +110,6 @@ print_only(FILE *f) } } -static void -help(char * exename) -{ - printf( "ncom - Narthex combinator %s\n" - "By Michael C. Dim. <mk@mcdim.xyz>\n\n" - - "-d Use dot separator\n" - "-u Use underscore separator\n" - "-m Use hyphen separator\n" - "-n Exclude numerical bases\n" - "-b Exclude base-appended\n" - "-h Print this panel & exit\n" - "-v Print current version & exit\n\n" - - "Usage: cat [FILENAME] | %s [OPTIONS]\n", - VERSION, exename); - exit(EXIT_SUCCESS); -} - -static void -die(char * str) -{ - printf("%s\n", str); - exit(EXIT_SUCCESS); -} - void main(int argc, char * argv[]) {