Re: [perl #32687] Encode::is_utf8 on tainted UTF8 string
[p5sagit/p5-mst-13.2.git] / ext / Encode / Encode / encode.h
index 94764a6..0dcf83d 100644 (file)
@@ -15,16 +15,16 @@ typedef struct encpage_s encpage_t;
 
 struct encpage_s
 {
-       /* fields ordered to pack nicely on 32-bit machines */
-       const U8   *seq;       /* Packed output sequences we generate 
-                                 if we match */
-       encpage_t  *next;      /* Page to go to if we match */
-       U8         min;        /* Min value of octet to match this entry */
-       U8         max;        /* Max value of octet to match this entry */
-       U8         dlen;       /* destination length - 
-                                 size of entries in seq */
-       U8         slen;       /* source length - 
-                                 number of source octets needed */
+    /* fields ordered to pack nicely on 32-bit machines */
+    const U8 *const seq;   /* Packed output sequences we generate 
+                  if we match */
+    const encpage_t *const next;      /* Page to go to if we match */
+    const U8   min;        /* Min value of octet to match this entry */
+    const U8   max;        /* Max value of octet to match this entry */
+    const U8   dlen;       /* destination length - 
+                  size of entries in seq */
+    const U8   slen;       /* source length - 
+                  number of source octets needed */
 };
 
 /*
@@ -60,24 +60,26 @@ struct encpage_s
 typedef struct encode_s encode_t;
 struct encode_s
 {
-       encpage_t  *t_utf8;    /* Starting table for translation from 
-                                 the encoding to UTF-8 form */
-       encpage_t  *f_utf8;    /* Starting table for translation 
-                                 from UTF-8 to the encoding */
-       const U8   *rep;       /* Replacement character in this encoding 
-                                 e.g. "?" */
-       int        replen;     /* Number of octets in rep */
-       U8         min_el;     /* Minimum octets to represent a character */
-       U8         max_el;     /* Maximum octets to represent a character */
-       const char *name[2];   /* name(s) of this encoding */
+    const encpage_t *const t_utf8;  /* Starting table for translation from 
+                       the encoding to UTF-8 form */
+    const encpage_t *const f_utf8;  /* Starting table for translation 
+                       from UTF-8 to the encoding */
+    const U8 *const rep;            /* Replacement character in this
+                       encoding e.g. "?" */
+    int        replen;              /* Number of octets in rep */
+    U8         min_el;              /* Minimum octets to represent a
+                       character */
+    U8         max_el;              /* Maximum octets to represent a
+                       character */
+    const char *const name[2];      /* name(s) of this encoding */
 };
 
 #ifdef U8
 /* See comment at top of file for deviousness */
 
-extern int do_encode(encpage_t *enc, const U8 *src, STRLEN *slen,
+extern int do_encode(const encpage_t *enc, const U8 *src, STRLEN *slen,
                      U8 *dst, STRLEN dlen, STRLEN *dout, int approx,
-                    const U8 *term, STRLEN tlen);
+             const U8 *term, STRLEN tlen);
 
 extern void Encode_DefineEncoding(encode_t *enc);