-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathext.diff
More file actions
166 lines (140 loc) · 3.17 KB
/
ext.diff
File metadata and controls
166 lines (140 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
diff -U7 ext.orig/generate.c ext.new/generate.c
--- ext.orig/generate.c
+++ ext.new/generate.c
@@ -173,24 +173,29 @@
char bfr[80];
va_list ptr;
va_start(ptr,fmt);
vsnprintf(bfr, sizeof bfr, fmt, ptr);
va_end(ptr);
Qstring(bfr, f);
+}
+
+
+static int Qchar_mkd_sta_function_t(const int n, const void* iot) {
+ Qchar(n, iot);
}
/* Qanchor() prints out a suitable-for-id-tag version of a string
*/
static void
Qanchor(struct line *p, MMIOT *f)
{
mkd_string_to_anchor(T(p->text), S(p->text),
- (mkd_sta_function_t)Qchar, f, 1, f);
+ Qchar_mkd_sta_function_t, f, 1, f);
}
/* Qem()
*/
static void
Qem(MMIOT *f, char c, int count)
@@ -622,16 +627,15 @@
} /* printlinkyref */
/* helper function for php markdown extra footnotes; allow the user to
* define a prefix tag instead of just `fn`
*/
static char *
-p_or_nothing(p)
-MMIOT *p;
+p_or_nothing(MMIOT *p)
{
return p->ref_prefix ? p->ref_prefix : "fn";
}
/* php markdown extra/daring fireball style print footnotes
*/
diff -U7 ext.orig/gethopt.c ext.new/gethopt.c
--- ext.orig/gethopt.c
+++ ext.new/gethopt.c
@@ -6,64 +6,54 @@
#include <stdio.h>
#include <string.h>
#include "gethopt.h"
void
-hoptset(ctx, argc, argv)
-struct h_context *ctx;
-int argc;
-char **argv;
+hoptset(struct h_context *ctx, int argc, char **argv)
{
memset(ctx, 0, sizeof *ctx);
ctx->argc = argc;
ctx->argv = argv;
ctx->optind = 1;
}
char *
-hoptarg(ctx)
-struct h_context *ctx;
+hoptarg(struct h_context *ctx)
{
return ctx->optarg;
}
int
-hoptind(ctx)
-struct h_context *ctx;
+hoptind(struct h_context *ctx)
{
return ctx->optind;
}
char
-hoptopt(ctx)
-struct h_context *ctx;
+hoptopt(struct h_context *ctx)
{
return ctx->optopt;
}
int
-hopterr(ctx,val)
-struct h_context *ctx;
+hopterr(struct h_context *ctx, int val)
{
int old = ctx->opterr;
ctx->opterr = !!val;
return old;
}
struct h_opt *
-gethopt(ctx, opts, nropts)
-struct h_context *ctx;
-struct h_opt *opts;
-int nropts;
+gethopt(struct h_context *ctx, struct h_opt *opts, int nropts)
{
int i;
int dashes;
if ( (ctx == 0) || ctx->optend || (ctx->optind >= ctx->argc) )
return 0;
diff -U7 ext.orig/toc.c ext.new/toc.c
--- ext.orig/toc.c
+++ ext.new/toc.c
@@ -11,14 +11,19 @@
#include <stdlib.h>
#include <ctype.h>
#include "cstring.h"
#include "markdown.h"
#include "amalloc.h"
+static int Csputc_mkd_sta_function_t(const int n, const void* iot) {
+ Csputc(n, iot);
+}
+
+
/* write an header index
*/
int
mkd_toc(Document *p, char **doc)
{
Paragraph *tp, *srcp;
int last_hnumber = 0;
@@ -60,15 +65,15 @@
if ( (srcp->hnumber - last_hnumber) > 1 )
Csprintf(&res, "%*s<li>\n", last_hnumber+1, "");
++last_hnumber;
}
Csprintf(&res, "%*s<li><a href=\"#", srcp->hnumber, "");
mkd_string_to_anchor(T(srcp->text->text),
S(srcp->text->text),
- (mkd_sta_function_t)Csputc,
+ Csputc_mkd_sta_function_t,
&res,1,p->ctx);
Csprintf(&res, "\">");
Csreparse(&res, T(srcp->text->text),
S(srcp->text->text), IS_LABEL);
Csprintf(&res, "</a>");
first = 0;