From d8b21171a1d50ec5aa6de7fe02950c0a2a10b91b Mon Sep 17 00:00:00 2001 From: Matt Mascarenhas Date: Wed, 23 Aug 2017 21:30:08 +0100 Subject: [PATCH] hmml_to_html.c: Begin refactor --- hmml_to_html/hmml_to_html.c | 94 ++++++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 11 deletions(-) diff --git a/hmml_to_html/hmml_to_html.c b/hmml_to_html/hmml_to_html.c index 4ef0b44..53023e5 100644 --- a/hmml_to_html/hmml_to_html.c +++ b/hmml_to_html/hmml_to_html.c @@ -1,6 +1,6 @@ #if 0 ctime -begin ${0%.*}.ctm -gcc -g -no-pie -fsanitize=address -Wall -std=c99 -pipe $0 -o ${0%.*} hmml.a -lcurl +gcc -g -fsanitize=address -Wall -std=c99 -pipe $0 -o ${0%.*} hmml.a -lcurl ctime -end ${0%.*}.ctm exit #endif @@ -21,6 +21,8 @@ typedef unsigned int bool; #include #include #include +#include +#include #define Kilobytes(Bytes) Bytes << 10 #define Megabytes(Bytes) Bytes << 20 @@ -123,7 +125,7 @@ category_medium CategoryMedium[] = { "trivia", "🎲", "Trivia"}, }; -#define EDITION EDITION_SINGLE +int EDITION = EDITION_SINGLE; #define ArrayCount(A) sizeof(A)/sizeof(*(A)) @@ -1421,11 +1423,13 @@ ParseConfig(buffer *Buffer, char *Username) #endif void -PrintUsage(char *BinaryLocation, char *DefaultCSSDir, char *DefaultImagesDir, char *DefaultJSDir, char *DefaultDefaultMedium, char *DefaultOutLocation, char *DefaultTemplateLocation) +PrintUsage(char *BinaryLocation, char *DefaultBaseDirectory, char *DefaultCSSDir, char *DefaultImagesDir, char *DefaultJSDir, char *DefaultDefaultMedium, char *DefaultOutLocation, char *DefaultProjectDirectory, char *DefaultTemplateLocation) { fprintf(stderr, "Usage: %s [option(s)] filename(s)\n" "\n" "Options:\n" + " -b \n" + " Override default base output directory (\"%s\")\n" " -c \n" " Override default CSS directory (\"%s\")\n" " -f\n" @@ -1438,6 +1442,8 @@ PrintUsage(char *BinaryLocation, char *DefaultCSSDir, char *DefaultImagesDir, ch " Override default default medium (\"%s\")\n" " -o \n" " Override default output location (\"%s\")\n" + " -p \n" + " Override default project directory (\"%s\")\n" " -t