]> mj.ucw.cz Git - libucw.git/commitdiff
licharset: added const qualifiers
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Thu, 21 Jun 2007 09:22:13 +0000 (11:22 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Thu, 21 Jun 2007 09:22:13 +0000 (11:22 +0200)
charset/charconv.h
charset/mp-charconv.c
charset/mp-charconv.h
charset/setnames.c
charset/stk-charconv.c
charset/stk-charconv.h

index ed775b137b0e26cf27c2fa893f87452aedbaf1f1..78b3ac73caa938e953c1390b25c62f2aa9d7ef8b 100644 (file)
@@ -78,7 +78,7 @@ unsigned int conv_x_count(void);
 
 /* Charset names */
 
-int find_charset_by_name(char *);
+int find_charset_by_name(const char *);
 char *charset_name(int);
 
 #endif
index ef0adf951c83a0b5de0a026763bccb5b1c7f0a06..7c18d40f90fee7255c8e3f75714189ddfe205331 100644 (file)
@@ -13,7 +13,7 @@
 #include <alloca.h>
 
 byte *
-mp_strconv(struct mempool *mp, byte *s, uns in_cs, uns out_cs)
+mp_strconv(struct mempool *mp, const byte *s, uns in_cs, uns out_cs)
 {
   if (in_cs == out_cs)
     return mp_strdup(mp, s);
index f33cd373e590620a7ceb9e6051d3b166fc89952c..ab6f65d924f71708bf6723afb296c0ebe45558a6 100644 (file)
 #include "lib/mempool.h"
 #include "charset/charconv.h"
 
-byte *mp_strconv(struct mempool *mp, byte *s, uns cs_in, uns cs_out);
+byte *mp_strconv(struct mempool *mp, const byte *s, uns cs_in, uns cs_out);
 
 static inline byte *
-mp_strconv_to_utf8(struct mempool *mp, byte *s, uns cs_in)
+mp_strconv_to_utf8(struct mempool *mp, const byte *s, uns cs_in)
 { return mp_strconv(mp, s, cs_in, CONV_CHARSET_UTF8); }
 
 static inline byte *
-mp_strconv_from_utf8(struct mempool *mp, byte *s, uns cs_out)
+mp_strconv_from_utf8(struct mempool *mp, const byte *s, uns cs_out)
 { return mp_strconv(mp, s, CONV_CHARSET_UTF8, cs_out); }
 
 #endif
index 02dd6a3c201c12471b83ff5c5a86ada2d75e8920..94c7d17e019490b27648deb0db2542e1d93d505e 100644 (file)
@@ -14,7 +14,7 @@
 
 /* Names according to RFC 1345 (see http://www.iana.org/assignments/character-sets) */
 
-static char *cs_names[] = {
+static const char *cs_names[] = {
        "US-ASCII",
        "ISO-8859-1",
        "ISO-8859-2",
@@ -43,7 +43,7 @@ static char *cs_names[] = {
 };
 
 int
-find_charset_by_name(char *c)
+find_charset_by_name(const char *c)
 {
        unsigned int i;
 
@@ -59,5 +59,5 @@ charset_name(int i)
   if (i < 0 || i > CONV_NUM_CHARSETS)
     return "x-unknown";
   else
-    return cs_names[i];
+    return (char *)cs_names[i];
 }
index d5f55fed9e55a599a9e9e8e033ea79c5a8aa06a3..a40a7edb1e736f96c06a858f850ddcfe106a054b 100644 (file)
@@ -15,7 +15,7 @@
 #define INITIAL_SCALE          2
 
 uns
-stk_strconv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs)
+stk_strconv_init(struct conv_context *c, const byte *s, uns in_cs, uns out_cs)
 {
   uns l = strlen(s);
   if (in_cs == out_cs)
index 3b47940f317d63ce7f99e943b3512835d26cccbd..1eb368d11cb5490aaeff8e3ff9fb90cf8f02589d 100644 (file)
@@ -24,7 +24,7 @@
 
 /* Internals */
 
-uns stk_strconv_init(struct conv_context *c, byte *s, uns cs_in, uns cs_out);
+uns stk_strconv_init(struct conv_context *c, const byte *s, uns cs_in, uns cs_out);
 uns stk_strconv_step(struct conv_context *c, byte *buf, uns len);
 
 #endif