aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--parse-file.c51
-rw-r--r--parse-file.h4
-rw-r--r--test-convert-markdown.c6
4 files changed, 32 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 870970d..ce1dc8c 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ OBJS = parse-file.o compats.o
TESTOBJS = test-convert-markdown.o
convert-markdown: $(OBJS)
- $(CC) $(OBJS) convert-markdown.c -o $@ $(LDFLAGS) $(LDADD)
+ $(CC) -g -O2 $(OBJS) convert-markdown.c -o $@ $(LDFLAGS) $(LDADD)
$(OBJS): config.h
diff --git a/parse-file.c b/parse-file.c
index 215e13a..9c07849 100644
--- a/parse-file.c
+++ b/parse-file.c
@@ -17,30 +17,31 @@
#include "parse-file.h"
-void _parse_file(FILE* instream, FILE* outstream) {
- // adapted from the example section of lowdown_file(3)
- struct lowdown_opts opts;
- char *buf;
- size_t bufsz;
+void _parse_file(FILE *instream, FILE *outstream) {
+ // adapted from the example section of lowdown_file(3)
+ struct lowdown_opts opts;
+ char *buf;
+ size_t bufsz;
- memset(&opts, 0, sizeof(struct lowdown_opts));
- opts.type = LOWDOWN_HTML;
- opts.feat = LOWDOWN_FOOTNOTES |
- LOWDOWN_AUTOLINK |
- LOWDOWN_TABLES |
- LOWDOWN_SUPER |
- LOWDOWN_STRIKE |
- LOWDOWN_FENCED |
- LOWDOWN_COMMONMARK |
- LOWDOWN_DEFLIST |
- LOWDOWN_IMG_EXT |
- LOWDOWN_METADATA;
- opts.oflags = LOWDOWN_HTML_HEAD_IDS |
- LOWDOWN_HTML_NUM_ENT |
- LOWDOWN_HTML_OWASP |
- LOWDOWN_SMARTY;
- if (!lowdown_file(&opts, instream, &buf, &bufsz, NULL))
- errx(1, "lowdown_file");
- fwrite(buf, 1, bufsz, outstream);
- free(buf);
+ memset(&opts, 0, sizeof(struct lowdown_opts));
+ opts.type = LOWDOWN_HTML;
+ opts.feat = LOWDOWN_FOOTNOTES |
+ LOWDOWN_AUTOLINK |
+ LOWDOWN_TABLES |
+ LOWDOWN_SUPER |
+ LOWDOWN_STRIKE |
+ LOWDOWN_FENCED |
+ LOWDOWN_COMMONMARK |
+ LOWDOWN_DEFLIST |
+ LOWDOWN_IMG_EXT |
+ LOWDOWN_METADATA;
+ opts.oflags = LOWDOWN_HTML_HEAD_IDS |
+ LOWDOWN_HTML_NUM_ENT |
+ LOWDOWN_HTML_OWASP |
+ LOWDOWN_SMARTY;
+ if (!lowdown_file(&opts, instream, &buf, &bufsz, NULL)) {
+ errx(1, "lowdown_file");
+ }
+ fwrite(buf, 1, bufsz, outstream);
+ free(buf);
}
diff --git a/parse-file.h b/parse-file.h
index 30f292f..4d7c2e6 100644
--- a/parse-file.h
+++ b/parse-file.h
@@ -28,6 +28,6 @@
#include <sys/queue.h>
#include <lowdown.h>
-void _parse_file(FILE*, FILE*);
+void _parse_file(FILE *, FILE *);
-#endif \ No newline at end of file
+#endif
diff --git a/test-convert-markdown.c b/test-convert-markdown.c
index d2eb1a7..936b118 100644
--- a/test-convert-markdown.c
+++ b/test-convert-markdown.c
@@ -16,9 +16,9 @@
#include "parse-file.h"
-static int test_parse_file(const char* testname, const char* input, const char* output) {
- FILE* instream = tmpfile();
- FILE* outstream = tmpfile();
+static int test_parse_file(const char *testname, const char *input, const char *output) {
+ FILE *instream = tmpfile();
+ FILE *outstream = tmpfile();
if (instream == NULL || outstream == NULL) {
printf("Error opening temporary file(s)");