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 #include #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 #include #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
  • \n", last_hnumber+1, ""); ++last_hnumber; } Csprintf(&res, "%*s
  • 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, ""); first = 0;