]> granicus.if.org Git - apache/commitdiff
* modules/filters/mod_proxy_html.c: Fix various code style issues.
authorRainer Jung <rjung@apache.org>
Tue, 31 Jan 2012 17:36:22 +0000 (17:36 +0000)
committerRainer Jung <rjung@apache.org>
Tue, 31 Jan 2012 17:36:22 +0000 (17:36 +0000)
* Use apr_is* ctype macro wrappers.

Backport of r1200556 from trunk.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1238699 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_proxy_html.c

index a1c5fbfba388aa7fa24619dcbbfd8e1f2af85c37..54e3259938cacbf56e0d73d1e255bcb47a740f69 100644 (file)
@@ -29,8 +29,6 @@
 #define VERBOSEB(x) if (verbose) {x}
 #endif
 
-#include <ctype.h>
-
 /* libxml2 */
 #include <libxml/HTMLparser.h>
 
@@ -40,6 +38,7 @@
 #include "apr_strings.h"
 #include "apr_hash.h"
 #include "apr_strmatch.h"
+#include "apr_lib.h"
 
 #include "apr_optional.h"
 #include "mod_xml2enc.h"
@@ -47,8 +46,8 @@
 #include "ap_expr.h"
 
 /* globals set once at startup */
-static ap_rxplus_told_expr;
-static ap_regex_tseek_meta;
+static ap_rxplus_t *old_expr;
+static ap_regex_t *seek_meta;
 static const apr_strmatch_pattern* seek_content;
 static apr_status_t (*xml2enc_charset)(request_rec*, xmlCharEncoding*, const char**) = NULL;
 static apr_status_t (*xml2enc_filter)(request_rec*, const char*, unsigned int) = NULL;
@@ -67,32 +66,32 @@ module AP_MODULE_DECLARE_DATA proxy_html_module;
 #define M_INTERPOLATE_FROM      0x200
 
 typedef struct {
-    const charval;
+    const char *val;
 } tattr;
 typedef struct {
     unsigned int start;
     unsigned int end;
 } meta;
 typedef struct urlmap {
-    struct urlmapnext;
+    struct urlmap *next;
     unsigned int flags;
     unsigned int regflags;
     union {
-        const charc;
-        ap_regex_tr;
+        const char *c;
+        ap_regex_t *r;
     } from;
-    const charto;
+    const char *to;
     ap_expr_info_t *cond;
 } urlmap;
 typedef struct {
-    urlmapmap;
-    const chardoctype;
-    const charetag;
+    urlmap *map;
+    const char *doctype;
+    const char *etag;
     unsigned int flags;
     size_t bufsz;
-    apr_hash_tlinks;
-    apr_array_header_tevents;
-    const charcharset_out;
+    apr_hash_t *links;
+    apr_array_header_t *events;
+    const char *charset_out;
     int extfix;
     int metafix;
     int strip_comments;
@@ -100,15 +99,15 @@ typedef struct {
     int enabled;
 } proxy_html_conf;
 typedef struct {
-    ap_filter_tf;
-    proxy_html_confcfg;
+    ap_filter_t *f;
+    proxy_html_conf *cfg;
     htmlParserCtxtPtr parser;
-    apr_bucket_brigadebb;
-    charbuf;
+    apr_bucket_brigade *bb;
+    char *buf;
     size_t offset;
     size_t avail;
-    const charencoding;
-    urlmapmap;
+    const char *encoding;
+    urlmap *map;
 } saxctxt;
 
 
@@ -119,23 +118,23 @@ static htmlSAXHandler sax;
 
 typedef enum { ATTR_IGNORE, ATTR_URI, ATTR_EVENT } rewrite_t;
 
-static const charconst fpi_html =
+static const char *const fpi_html =
         "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n";
-static const charconst fpi_html_legacy =
+static const char *const fpi_html_legacy =
         "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
-static const charconst fpi_xhtml =
+static const char *const fpi_xhtml =
         "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
-static const charconst fpi_xhtml_legacy =
+static const char *const fpi_xhtml_legacy =
         "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
-static const charconst html_etag = ">";
-static const charconst xhtml_etag = " />";
+static const char *const html_etag = ">";
+static const char *const xhtml_etag = " />";
 /*#define DEFAULT_DOCTYPE fpi_html */
-static const charconst DEFAULT_DOCTYPE = "";
+static const char *const DEFAULT_DOCTYPE = "";
 #define DEFAULT_ETAG html_etag
 
-static void normalise(unsigned int flags, charstr)
+static void normalise(unsigned int flags, char *str)
 {
-    charp;
+    char *p;
     if (flags & NORM_LC)
         for (p = str; *p; ++p)
             if (isupper(*p))
@@ -154,10 +153,10 @@ static void normalise(unsigned int flags, char* str)
 
 /* This is always utf-8 on entry.  We can convert charset within FLUSH */
 #define FLUSH AP_fwrite(ctx, (chars+begin), (i-begin), 0); begin = i+1
-static void pcharacters(voidctxt, const xmlChar *uchars, int length)
+static void pcharacters(void *ctxt, const xmlChar *uchars, int length)
 {
-    const charchars = (const char*) uchars;
-    saxctxtctx = (saxctxt*) ctxt;
+    const char *chars = (const char*) uchars;
+    saxctxt *ctx = (saxctxt*) ctxt;
     int i;
     int begin;
     for (begin=i=0; i<length; i++) {
@@ -171,9 +170,10 @@ static void pcharacters(void* ctxt, const xmlChar *uchars, int length)
     }
     FLUSH;
 }
-static void preserve(saxctxt* ctx, const size_t len)
+
+static void preserve(saxctxt *ctx, const size_t len)
 {
-    charnewbuf;
+    char *newbuf;
     if (len <= (ctx->avail - ctx->offset))
         return;
     else while (len > (ctx->avail - ctx->offset))
@@ -189,24 +189,26 @@ static void preserve(saxctxt* ctx, const size_t len)
         ctx->buf = newbuf;
     }
 }
-static void pappend(saxctxt* ctx, const char* buf, const size_t len)
+
+static void pappend(saxctxt *ctx, const char *buf, const size_t len)
 {
     preserve(ctx, len);
     memcpy(ctx->buf+ctx->offset, buf, len);
     ctx->offset += len;
 }
-static void dump_content(saxctxt* ctx)
+
+static void dump_content(saxctxt *ctx)
 {
-    urlmapm;
-    charfound;
+    urlmap *m;
+    char *found;
     size_t s_from, s_to;
     size_t match;
     char c = 0;
     int nmatch;
     ap_regmatch_t pmatch[10];
-    charsubs;
+    char *subs;
     size_t len, offs;
-    urlmapthemap = ctx->map;
+    urlmap *themap = ctx->map;
 #ifndef GO_FASTER
     int verbose = APLOGrtrace1(ctx->f->r);
 #endif
@@ -228,7 +230,7 @@ static void dump_content(saxctxt* ctx)
                 len = strlen(ctx->buf);
                 offs += match;
                 VERBOSEB(
-                    const charf = apr_pstrndup(ctx->f->r->pool,
+                    const char *f = apr_pstrndup(ctx->f->r->pool,
                     ctx->buf + offs, s_from);
                     ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, ctx->f->r,
                                   "C/RX: match at %s, substituting %s", f, subs);
@@ -277,10 +279,10 @@ static void dump_content(saxctxt* ctx)
     }
     AP_fwrite(ctx, ctx->buf, strlen(ctx->buf), 1);
 }
-static void pcdata(voidctxt, const xmlChar *uchars, int length)
+static void pcdata(void *ctxt, const xmlChar *uchars, int length)
 {
-    const charchars = (const char*) uchars;
-    saxctxtctx = (saxctxt*) ctxt;
+    const char *chars = (const char*) uchars;
+    saxctxt *ctx = (saxctxt*) ctxt;
     if (ctx->cfg->extfix) {
         pappend(ctx, chars, length);
     }
@@ -291,10 +293,10 @@ static void pcdata(void* ctxt, const xmlChar *uchars, int length)
         AP_fwrite(ctx, chars, length, 0);
     }
 }
-static void pcomment(voidctxt, const xmlChar *uchars)
+static void pcomment(void *ctxt, const xmlChar *uchars)
 {
-    const charchars = (const char*) uchars;
-    saxctxtctx = (saxctxt*) ctxt;
+    const char *chars = (const char*) uchars;
+    saxctxt *ctx = (saxctxt*) ctxt;
     if (ctx->cfg->strip_comments)
         return;
 
@@ -309,10 +311,10 @@ static void pcomment(void* ctxt, const xmlChar *uchars)
         ap_fputs(ctx->f->next, ctx->bb, "-->");
     }
 }
-static void pendElement(void* ctxt, const xmlChar* uname)
+static void pendElement(void *ctxt, const xmlChar *uname)
 {
-    saxctxtctx = (saxctxt*) ctxt;
-    const charname = (const char*) uname;
+    saxctxt *ctx = (saxctxt*) ctxt;
+    const char *name = (const char*) uname;
     const htmlElemDesc* desc = htmlTagLookup(uname);
 
     if ((ctx->cfg->doctype == fpi_html) || (ctx->cfg->doctype == fpi_xhtml)) {
@@ -338,19 +340,20 @@ static void pendElement(void* ctxt, const xmlChar* uname)
         ap_fprintf(ctx->f->next, ctx->bb, "</%s>", name);
     }
 }
-static void pstartElement(void* ctxt, const xmlChar* uname,
+
+static void pstartElement(void *ctxt, const xmlChar *uname,
                           const xmlChar** uattrs)
 {
     int required_attrs;
     int num_match;
     size_t offs, len;
-    charsubs;
+    char *subs;
     rewrite_t is_uri;
     const char** a;
-    urlmapm;
+    urlmap *m;
     size_t s_to, s_from, match;
-    charfound;
-    saxctxtctx = (saxctxt*) ctxt;
+    char *found;
+    saxctxt *ctx = (saxctxt*) ctxt;
     size_t nmatch;
     ap_regmatch_t pmatch[10];
 #ifndef GO_FASTER
@@ -358,10 +361,10 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
 #endif
     apr_array_header_t *linkattrs;
     int i;
-    const charname = (const char*) uname;
+    const char *name = (const char*) uname;
     const char** attrs = (const char**) uattrs;
     const htmlElemDesc* desc = htmlTagLookup(uname);
-    urlmapthemap = ctx->map;
+    urlmap *themap = ctx->map;
 #ifdef HAVE_STACK
     const void** descp;
 #endif
@@ -432,7 +435,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
                 pappend(ctx, a[1], strlen(a[1])+1);
                 is_uri = ATTR_IGNORE;
                 if (linkattrs) {
-                    tattrattrs = (tattr*) linkattrs->elts;
+                    tattr *attrs = (tattr*) linkattrs->elts;
                     for (i=0; i < linkattrs->nelts; ++i) {
                         if (!strcmp(*a, attrs[i].val)) {
                             is_uri = ATTR_URI;
@@ -443,7 +446,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
                 if ((is_uri == ATTR_IGNORE) && ctx->cfg->extfix
                     && (ctx->cfg->events != NULL)) {
                     for (i=0; i < ctx->cfg->events->nelts; ++i) {
-                        tattrattrs = (tattr*) ctx->cfg->events->elts;
+                        tattr *attrs = (tattr*) ctx->cfg->events->elts;
                         if (!strcmp(*a, attrs[i].val)) {
                             is_uri = ATTR_EVENT;
                             break;
@@ -466,7 +469,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
                                 subs = ap_pregsub(ctx->f->r->pool, m->to,
                                                   ctx->buf, nmatch, pmatch);
                                 VERBOSE({
-                                    const charf;
+                                    const char *f;
                                     f = apr_pstrndup(ctx->f->r->pool,
                                                      ctx->buf + offs, s_from);
                                     ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0,
@@ -534,7 +537,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
                                 subs = ap_pregsub(ctx->f->r->pool, m->to, ctx->buf+offs,
                                                     nmatch, pmatch);
                                 VERBOSE({
-                                    const charf;
+                                    const char *f;
                                     f = apr_pstrndup(ctx->f->r->pool,
                                                      ctx->buf + offs, s_from);
                                     ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0,
@@ -639,14 +642,14 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
     }
 }
 
-static meta* metafix(request_rec* r, const char* buf)
+static meta *metafix(request_rec *r, const char *buf)
 {
-    metaret = NULL;
+    meta *ret = NULL;
     size_t offs = 0;
-    const charp;
-    const charq;
-    charheader;
-    charcontent;
+    const char *p;
+    const char *q;
+    char *header;
+    char *content;
     ap_regmatch_t pmatch[2];
     char delim;
 
@@ -654,8 +657,8 @@ static meta* metafix(request_rec* r, const char* buf)
         header = NULL;
         content = NULL;
         p = buf+offs+pmatch[1].rm_eo;
-        while (!isalpha(*++p));
-        for (q = p; isalnum(*q) || (*q == '-'); ++q);
+        while (!apr_isalpha(*++p));
+        for (q = p; apr_isalnum(*q) || (*q == '-'); ++q);
         header = apr_pstrndup(r->pool, p, q-p);
         if (strncasecmp(header, "Content-", 8)) {
             /* find content=... string */
@@ -665,16 +668,16 @@ static meta* metafix(request_rec* r, const char* buf)
             if (p != NULL) {
                 while (*p) {
                     p += 7;
-                    while (*p && isspace(*p))
+                    while (*p && apr_isspace(*p))
                         ++p;
                     if (*p != '=')
                         continue;
-                    while (*p && isspace(*++p));
+                    while (*p && apr_isspace(*++p));
                     if ((*p == '\'') || (*p == '"')) {
                         delim = *p++;
                         for (q = p; *q != delim; ++q);
                     } else {
-                        for (q = p; *q && !isspace(*q) && (*q != '>'); ++q);
+                        for (q = p; *q && !apr_isspace(*q) && (*q != '>'); ++q);
                     }
                     content = apr_pstrndup(r->pool, p, q-p);
                     break;
@@ -699,15 +702,15 @@ static meta* metafix(request_rec* r, const char* buf)
     return ret;
 }
 
-static const char* interpolate_vars(request_rec* r, const char* str)
+static const char *interpolate_vars(request_rec *r, const char *str)
 {
-    const charstart;
-    const charend;
-    const chardelim;
-    const charbefore;
-    const charafter;
-    const charreplacement;
-    const charvar;
+    const char *start;
+    const char *end;
+    const char *delim;
+    const char *before;
+    const char *after;
+    const char *replacement;
+    const char *var;
     for (;;) {
         start = str;
         if (start = ap_strstr_c(start, "${"), start == NULL)
@@ -738,12 +741,12 @@ static const char* interpolate_vars(request_rec* r, const char* str)
     }
     return str;
 }
-static void fixup_rules(saxctxtctx)
+static void fixup_rules(saxctxt *ctx)
 {
-    urlmapnewp;
-    urlmapp;
-    urlmapprev = NULL;
-    request_recr = ctx->f->r;
+    urlmap *newp;
+    urlmap *p;
+    urlmap *prev = NULL;
+    request_rec *r = ctx->f->r;
 
     for (p = ctx->cfg->map; p; p = p->next) {
         if (p->cond != NULL) {
@@ -787,13 +790,14 @@ static void fixup_rules(saxctxt* ctx)
     if (prev)
         prev->next = NULL;
 }
-static saxctxt* check_filter_init (ap_filter_t* f)
+
+static saxctxt *check_filter_init (ap_filter_t *f)
 {
-    saxctxtfctx;
+    saxctxt *fctx;
     if (!f->ctx) {
-        proxy_html_confcfg;
-        const charforce;
-        const charerrmsg = NULL;
+        proxy_html_conf *cfg;
+        const char *force;
+        const char *errmsg = NULL;
         cfg = ap_get_module_config(f->r->per_dir_config, &proxy_html_module);
         force = apr_table_get(f->r->subprocess_env, "PROXY_HTML_FORCE");
 
@@ -839,19 +843,20 @@ static saxctxt* check_filter_init (ap_filter_t* f)
     }
     return f->ctx;
 }
-static int proxy_html_filter(ap_filter_t* f, apr_bucket_brigade* bb)
+
+static int proxy_html_filter(ap_filter_t *f, apr_bucket_brigade *bb)
 {
     apr_bucket* b;
-    metam = NULL;
+    meta *m = NULL;
     xmlCharEncoding enc;
-    const charbuf = 0;
+    const char *buf = 0;
     apr_size_t bytes = 0;
 #ifndef USE_OLD_LIBXML2
     int xmlopts = XML_PARSE_RECOVER | XML_PARSE_NONET |
                   XML_PARSE_NOBLANKS | XML_PARSE_NOERROR | XML_PARSE_NOWARNING;
 #endif
 
-    saxctxtctxt = check_filter_init(f);
+    saxctxt *ctxt = check_filter_init(f);
     if (!ctxt)
         return ap_pass_brigade(f->next, bb);
     for (b = APR_BRIGADE_FIRST(bb);
@@ -878,7 +883,7 @@ static int proxy_html_filter(ap_filter_t* f, apr_bucket_brigade* bb)
         else if (apr_bucket_read(b, &buf, &bytes, APR_BLOCK_READ)
                  == APR_SUCCESS) {
             if (ctxt->parser == NULL) {
-                const charcenc;
+                const char *cenc;
                 if (!xml2enc_charset ||
                     (xml2enc_charset(f->r, &enc, &cenc) != APR_SUCCESS)) {
                     if (!xml2enc_charset)
@@ -946,9 +951,9 @@ static int proxy_html_filter(ap_filter_t* f, apr_bucket_brigade* bb)
     return APR_SUCCESS;
 }
 
-static void* proxy_html_config(apr_pool_t* pool, char* x)
+static void *proxy_html_config(apr_pool_t *pool, char *x)
 {
-    proxy_html_confret = apr_pcalloc(pool, sizeof(proxy_html_conf));
+    proxy_html_conf *ret = apr_pcalloc(pool, sizeof(proxy_html_conf));
     ret->doctype = DEFAULT_DOCTYPE;
     ret->etag = DEFAULT_ETAG;
     ret->bufsz = 8192;
@@ -956,11 +961,12 @@ static void* proxy_html_config(apr_pool_t* pool, char* x)
     /* don't initialise links and events until they get set/used */
     return ret;
 }
-static void* proxy_html_merge(apr_pool_t* pool, void* BASE, void* ADD)
+
+static void *proxy_html_merge(apr_pool_t *pool, void *BASE, void *ADD)
 {
-    proxy_html_conf* base = (proxy_html_conf*) BASE;
-    proxy_html_conf* add = (proxy_html_conf*) ADD;
-    proxy_html_confconf = apr_palloc(pool, sizeof(proxy_html_conf));
+    proxy_html_conf *base = (proxy_html_conf *) BASE;
+    proxy_html_conf *add = (proxy_html_conf *) ADD;
+    proxy_html_conf *conf = apr_palloc(pool, sizeof(proxy_html_conf));
 
     /* don't merge declarations - just use the most specific */
     conf->links = (add->links == NULL) ? base->links : add->links;
@@ -970,15 +976,15 @@ static void* proxy_html_merge(apr_pool_t* pool, void* BASE, void* ADD)
                         ? base->charset_out : add->charset_out;
 
     if (add->map && base->map) {
-        urlmapa;
+        urlmap *a;
         conf->map = NULL;
         for (a = base->map; a; a = a->next) {
-            urlmapsave = conf->map;
+            urlmap *save = conf->map;
             conf->map = apr_pmemdup(pool, a, sizeof(urlmap));
             conf->map->next = save;
         }
         for (a = add->map; a; a = a->next) {
-            urlmapsave = conf->map;
+            urlmap *save = conf->map;
             conf->map = apr_pmemdup(pool, a, sizeof(urlmap));
             conf->map->next = save;
         }
@@ -1010,9 +1016,9 @@ static void* proxy_html_merge(apr_pool_t* pool, void* BASE, void* ADD)
 }
 #define REGFLAG(n,s,c) ((s&&(ap_strchr_c((s),(c))!=NULL)) ? (n) : 0)
 #define XREGFLAG(n,s,c) ((!s||(ap_strchr_c((s),(c))==NULL)) ? (n) : 0)
-static const char* comp_urlmap(cmd_parms *cmd, urlmap* newmap,
-                               const char* from, const char* to,
-                               const char* flags, const char* cond)
+static const char *comp_urlmap(cmd_parms *cmd, urlmap *newmap,
+                               const char *from, const char *to,
+                               const char *flags, const char *cond)
 {
     const char *err = NULL;
     newmap->flags
@@ -1067,18 +1073,19 @@ static const char* comp_urlmap(cmd_parms *cmd, urlmap* newmap,
     }
     return err;
 }
-static const char* set_urlmap(cmd_parms* cmd, void* CFG, const char* args)
+
+static const char *set_urlmap(cmd_parms *cmd, void *CFG, const char *args)
 {
-    proxy_html_conf* cfg = (proxy_html_conf*)CFG;
-    urlmapmap;
-    apr_pool_tpool = cmd->pool;
-    urlmapnewmap;
-    const charusage =
+    proxy_html_conf *cfg = (proxy_html_conf *)CFG;
+    urlmap *map;
+    apr_pool_t *pool = cmd->pool;
+    urlmap *newmap;
+    const char *usage =
               "Usage: ProxyHTMLURLMap from-pattern to-pattern [flags] [cond]";
-    const charfrom;
-    const charto;
-    const charflags;
-    const charcond = NULL;
+    const char *from;
+    const char *to;
+    const char *flags;
+    const char *cond = NULL;
   
     if (from = ap_getword_conf(cmd->pool, &args), !from)
         return usage;
@@ -1103,10 +1110,10 @@ static const char* set_urlmap(cmd_parms* cmd, void* CFG, const char* args)
     return comp_urlmap(cmd, newmap, from, to, flags, cond);
 }
 
-static const char* set_doctype(cmd_parms* cmd, void* CFG,
-                               const char* t, const char* l)
+static const char *set_doctype(cmd_parms *cmd, void *CFG,
+                               const char *t, const char *l)
 {
-    proxy_html_conf* cfg = (proxy_html_conf*)CFG;
+    proxy_html_conf *cfg = (proxy_html_conf *)CFG;
     if (!strcasecmp(t, "xhtml")) {
         cfg->etag = xhtml_etag;
         if (l && !strcasecmp(l, "legacy"))
@@ -1130,9 +1137,10 @@ static const char* set_doctype(cmd_parms* cmd, void* CFG,
     }
     return NULL;
 }
-static const char* set_flags(cmd_parms* cmd, void* CFG, const char* arg)
+
+static const char *set_flags(cmd_parms *cmd, void *CFG, const char *arg)
 {
-    proxy_html_confcfg = CFG;
+    proxy_html_conf *cfg = CFG;
     if (arg && *arg) {
         if (!strcmp(arg, "lowercase"))
             cfg->flags |= NORM_LC;
@@ -1143,22 +1151,24 @@ static const char* set_flags(cmd_parms* cmd, void* CFG, const char* arg)
     }
     return NULL;
 }
-static const char* set_events(cmd_parms* cmd, void* CFG, const char* arg)
+
+static const char *set_events(cmd_parms *cmd, void *CFG, const char *arg)
 {
-    tattrattr;
-    proxy_html_confcfg = CFG;
+    tattr *attr;
+    proxy_html_conf *cfg = CFG;
     if (cfg->events == NULL)
         cfg->events = apr_array_make(cmd->pool, 20, sizeof(tattr));
     attr = apr_array_push(cfg->events);
     attr->val = arg;
     return NULL;
 }
-static const char* set_links(cmd_parms* cmd, void* CFG,
-                             const char* elt, const char* att)
+
+static const char *set_links(cmd_parms *cmd, void *CFG,
+                             const char *elt, const char *att)
 {
-    apr_array_header_tattrs;
-    tattrattr;
-    proxy_html_confcfg = CFG;
+    apr_array_header_t *attrs;
+    tattr *attr;
+    proxy_html_conf *cfg = CFG;
 
     if (cfg->links == NULL)
         cfg->links = apr_hash_make(cmd->pool);
@@ -1209,7 +1219,7 @@ static const command_rec proxy_html_cmds[] = {
                  "Enable proxy-html and xml2enc filters"),
     { NULL }
 };
-static int mod_proxy_html(apr_pool_t* p, apr_pool_t* p1, apr_pool_t* p2)
+static int mod_proxy_html(apr_pool_t *p, apr_pool_t *p1, apr_pool_t *p2)
 {
     seek_meta = ap_pregcomp(p, "<meta[^>]*(http-equiv)[^>]*>",
                             AP_REG_EXTENDED|AP_REG_ICASE);
@@ -1233,9 +1243,9 @@ static int mod_proxy_html(apr_pool_t* p, apr_pool_t* p1, apr_pool_t* p2)
     old_expr = ap_rxplus_compile(p1, "s/^(!)?(\\w+)((=)(.+))?$/reqenv('$2')$1$4'$5'/");
     return OK;
 }
-static void proxy_html_insert(request_recr)
+static void proxy_html_insert(request_rec *r)
 {
-    proxy_html_confcfg;
+    proxy_html_conf *cfg;
     cfg = ap_get_module_config(r->per_dir_config, &proxy_html_module);
     if (cfg->enabled) {
         if (xml2enc_filter)
@@ -1243,9 +1253,9 @@ static void proxy_html_insert(request_rec* r)
         ap_add_output_filter("proxy-html", NULL, r, r->connection);
     }
 }
-static void proxy_html_hooks(apr_pool_tp)
+static void proxy_html_hooks(apr_pool_t *p)
 {
-    static const charaszSucc[] = { "mod_filter.c", NULL };
+    static const char *aszSucc[] = { "mod_filter.c", NULL };
     ap_register_output_filter_protocol("proxy-html", proxy_html_filter,
                                        NULL, AP_FTYPE_RESOURCE,
                           AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH);