11diff -U7 ext.orig/generate.c ext.new/generate.c
2- --- ext.orig/generate.c 2023-12-19 10:02:39.000000000 -0500
3- +++ ext.new/generate.c 2023-12-31 11:54:37.000000000 -0500
4- @@ -176,21 +176,26 @@
2+ --- ext.orig/generate.c
3+ +++ ext.new/generate.c
4+ @@ -173,24 +173,29 @@
5+ char bfr[80];
6+ va_list ptr;
7+
58 va_start(ptr,fmt);
69 vsnprintf(bfr, sizeof bfr, fmt, ptr);
710 va_end(ptr);
811 Qstring(bfr, f);
9- }
10-
11-
12- + static int Qchar_mkd_sta_function_t(const int n, const void* iot) {
13- + Qchar(n, iot);
1412+ }
1513+
1614+
15+ + static int Qchar_mkd_sta_function_t(const int n, const void* iot) {
16+ + Qchar(n, iot);
17+ }
18+
19+
1720 /* Qanchor() prints out a suitable-for-id-tag version of a string
1821 */
1922 static void
@@ -29,11 +32,68 @@ diff -U7 ext.orig/generate.c ext.new/generate.c
2932 */
3033 static void
3134 Qem(MMIOT *f, char c, int count)
35+ @@ -622,16 +627,15 @@
36+ } /* printlinkyref */
37+
38+
39+ /* helper function for php markdown extra footnotes; allow the user to
40+ * define a prefix tag instead of just `fn`
41+ */
42+ static char *
43+ - p_or_nothing(p)
44+ - MMIOT *p;
45+ + p_or_nothing(MMIOT *p)
46+ {
47+ return p->ref_prefix ? p->ref_prefix : "fn";
48+ }
49+
50+
51+ /* php markdown extra/daring fireball style print footnotes
52+ */
3253diff -U7 ext.orig/gethopt.c ext.new/gethopt.c
33- --- ext.orig/gethopt.c 2023-12-19 10:01:53.000000000 -0500
34- +++ ext.new/gethopt.c 2023-12-31 11:55:06.000000000 -0500
35- @@ -41,16 +41,15 @@
36- struct h_context *ctx;
54+ --- ext.orig/gethopt.c
55+ +++ ext.new/gethopt.c
56+ @@ -6,64 +6,54 @@
57+ #include <stdio.h>
58+ #include <string.h>
59+
60+ #include "gethopt.h"
61+
62+
63+ void
64+ - hoptset(ctx, argc, argv)
65+ - struct h_context *ctx;
66+ - int argc;
67+ - char **argv;
68+ + hoptset(struct h_context *ctx, int argc, char **argv)
69+ {
70+ memset(ctx, 0, sizeof *ctx);
71+ ctx->argc = argc;
72+ ctx->argv = argv;
73+ ctx->optind = 1;
74+ }
75+
76+
77+ char *
78+ - hoptarg(ctx)
79+ - struct h_context *ctx;
80+ + hoptarg(struct h_context *ctx)
81+ {
82+ return ctx->optarg;
83+ }
84+
85+ int
86+ - hoptind(ctx)
87+ - struct h_context *ctx;
88+ + hoptind(struct h_context *ctx)
89+ {
90+ return ctx->optind;
91+ }
92+
93+ char
94+ - hoptopt(ctx)
95+ - struct h_context *ctx;
96+ + hoptopt(struct h_context *ctx)
3797 {
3898 return ctx->optopt;
3999 }
@@ -50,9 +110,23 @@ diff -U7 ext.orig/gethopt.c ext.new/gethopt.c
50110 return old;
51111 }
52112
113+
114+ struct h_opt *
115+ - gethopt(ctx, opts, nropts)
116+ - struct h_context *ctx;
117+ - struct h_opt *opts;
118+ - int nropts;
119+ + gethopt(struct h_context *ctx, struct h_opt *opts, int nropts)
120+ {
121+ int i;
122+ int dashes;
123+
124+
125+ if ( (ctx == 0) || ctx->optend || (ctx->optind >= ctx->argc) )
126+ return 0;
53127diff -U7 ext.orig/toc.c ext.new/toc.c
54- --- ext.orig/toc.c 2023-12-19 10:01:53.000000000 -0500
55- +++ ext.new/toc.c 2023-12-31 11:56:16.000000000 -0500
128+ --- ext.orig/toc.c
129+ +++ ext.new/toc.c
56130@@ -11,14 +11,19 @@
57131 #include <stdlib.h>
58132 #include <ctype.h>
0 commit comments