pike.git / src / modules / _Charset / misc.c

version» Context lines:

pike.git/src/modules/_Charset/misc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: misc.c,v 1.21 2008/01/25 16:44:39 grubba Exp $ + || $Id: misc.c,v 1.22 2008/06/29 13:54:59 mast Exp $   */      #include "global.h" -  + #include "charsetmod.h"      /* Note: See tables.c for how the private space is used. */      static const p_wchar1 map_DEC_MCS[] = {    0xfffd, 0x00a1, 0x00a2, 0x00a3, 0xfffd, 0x00a5, 0xfffd, 0x00a7,    0x00a4, 0x00a9, 0x00aa, 0x00ab, 0xfffd, 0xfffd, 0xfffd, 0xfffd,    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0xfffd, 0x00b5, 0x00b6, 0x00b7,    0xfffd, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0xfffd, 0x00bf,    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
pike.git/src/modules/_Charset/misc.c:1928:    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, };         static const struct {    const char *name;    p_wchar1 const * table;    const int lo, hi; - } charset_map[] = { + } misc_charset_map[] = {    { "1026", map_IBM1026, 32, 255 }, /* :: ibm1026 */    { "1250", map_windows_1250, 128, 255 }, /* :: cp1250 */    { "1251", map_windows_1251, 128, 255 }, /* :: cp1251 */    { "1252", map_windows_1252, 128, 255 }, /* :: cp1252 */    { "1253", map_windows_1253, 128, 255 }, /* :: cp1253 */    { "1254", map_windows_1254, 128, 255 }, /* :: cp1254 */    { "1255", map_windows_1255, 128, 255 }, /* :: cp1255 */    { "1256", map_windows_1256, 128, 255 }, /* :: cp1256 */    { "1257", map_windows_1257, 128, 255 }, /* :: cp1257 */    { "1258", map_windows_1258, 128, 255 }, /* :: cp1258 */
pike.git/src/modules/_Charset/misc.c:2094:    { "windows1252", map_windows_1252, 128, 255 }, /* :: windows-1252 */    { "windows1253", map_windows_1253, 128, 255 }, /* :: windows-1253 */    { "windows1254", map_windows_1254, 128, 255 }, /* :: windows-1254 */    { "windows1255", map_windows_1255, 128, 255 }, /* :: windows-1255 */    { "windows1256", map_windows_1256, 128, 255 }, /* :: windows-1256 */    { "windows1257", map_windows_1257, 128, 255 }, /* :: windows-1257 */    { "windows1258", map_windows_1258, 128, 255 }, /* :: windows-1258 */    { "windows874", map_windows_874, 128, 255 }, /* :: windows-874 */    { "x0201", map_JIS_X0201, 92, 255 }, /* :: x0201 */   }; - #define NUM_CHARSETS (sizeof(charset_map)/sizeof(charset_map[0])) + #define NUM_CHARSETS (sizeof(misc_charset_map)/sizeof(misc_charset_map[0]))      p_wchar1 const *misc_charset_lookup(const char *name, int *rlo, int *rhi)   {    int lo=0, hi=NUM_CHARSETS-1;    while(lo<=hi) {    int c, mid = (lo+hi)>>1; -  if((c = strcmp(name, charset_map[mid].name))==0) { -  *rlo = charset_map[mid].lo; -  *rhi = charset_map[mid].hi; -  return charset_map[mid].table; +  if((c = strcmp(name, misc_charset_map[mid].name))==0) { +  *rlo = misc_charset_map[mid].lo; +  *rhi = misc_charset_map[mid].hi; +  return misc_charset_map[mid].table;    }    if(c<0)    hi=mid-1;    else    lo=mid+1;    }    return (p_wchar1 *)NULL;   }