ReactOS  0.4.14-dev-57-g333b8f1
nls_euc-jp.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/nls.h>
#include <linux/errno.h>
Include dependency graph for nls_euc-jp.c:

Go to the source code of this file.

Macros

#define IS_SJIS_LOW_BYTE(l)   ((0x40 <= (l)) && ((l) <= 0xFC) && ((l) != 0x7F))
 
#define IS_SJIS_JISX0208(h, l)
 
#define IS_SJIS_JISX0201KANA(c)   ((0xA1 <= (c)) && ((c) <= 0xDF))
 
#define IS_SJIS_UDC_LOW(h, l)
 
#define IS_SJIS_UDC_HI(h, l)
 
#define IS_SJIS_IBM(h, l)
 
#define IS_SJIS_NECIBM(h, l)
 
#define MAP_SJIS2EUC(sjis_hi, sjis_lo, sjis_p, euc_hi, euc_lo, euc_p)
 
#define SS2   (0x8E) /* Single Shift 2 */
 
#define SS3   (0x8F) /* Single Shift 3 */
 
#define IS_EUC_BYTE(c)   ((0xA1 <= (c)) && ((c) <= 0xFE))
 
#define IS_EUC_JISX0208(h, l)   (IS_EUC_BYTE(h) && IS_EUC_BYTE(l))
 
#define IS_EUC_JISX0201KANA(h, l)   (((h) == SS2) && (0xA1 <= (l) && (l) <= 0xDF))
 
#define IS_EUC_UDC_LOW(h, l)
 
#define IS_EUC_UDC_HI(h, l)   IS_EUC_UDC_LOW(h, l) /* G3 block */
 
#define MAP_EUC2SJIS(euc_hi, euc_lo, euc_p, sjis_hi, sjis_lo, sjis_p)
 
#define IS_EUC_IBM2JISX0208(h, l)   (((h) == 0xA2 && (l) == 0xCC) || ((h) == 0xA2 && (l) == 0xE8))
 
#define MAP_ELEMENT_OF(map)   (sizeof(map) / sizeof(map[0]))
 

Functions

static int sjisibm2euc (unsigned char *euc, const unsigned char sjis_hi, const unsigned char sjis_lo)
 
static int euc2sjisibm_jisx0212 (unsigned char *sjis, const unsigned char euc_hi, const unsigned char euc_lo)
 
static int euc2sjisibm_g3upper (unsigned char *sjis, const unsigned char euc_hi, const unsigned char euc_lo)
 
static int euc2sjisibm (unsigned char *sjis, const unsigned char euc_hi, const unsigned char euc_lo)
 
static int sjisnec2sjisibm (unsigned char *sjisibm, const unsigned char sjisnec_hi, const unsigned char sjisnec_lo)
 
static int uni2char (const wchar_t uni, unsigned char *out, int boundlen)
 
static int char2uni (const unsigned char *rawstring, int boundlen, wchar_t *uni)
 
static int __init init_nls_euc_jp (void)
 
static void __exit exit_nls_euc_jp (void)
 

Variables

static struct nls_tablep_nls
 
static unsigned char sjisibm2euc_map [][2]
 
struct {
   unsigned short   euc
 
   unsigned char   sjis [2]
 
euc2sjisibm_jisx0212_map []
 
static unsigned char euc2sjisibm_g3upper_map [][2]
 
static struct nls_table table
 

Macro Definition Documentation

◆ IS_EUC_BYTE

#define IS_EUC_BYTE (   c)    ((0xA1 <= (c)) && ((c) <= 0xFE))

Definition at line 43 of file nls_euc-jp.c.

◆ IS_EUC_IBM2JISX0208

#define IS_EUC_IBM2JISX0208 (   h,
  l 
)    (((h) == 0xA2 && (l) == 0xCC) || ((h) == 0xA2 && (l) == 0xE8))

Definition at line 141 of file nls_euc-jp.c.

◆ IS_EUC_JISX0201KANA

#define IS_EUC_JISX0201KANA (   h,
  l 
)    (((h) == SS2) && (0xA1 <= (l) && (l) <= 0xDF))

Definition at line 45 of file nls_euc-jp.c.

◆ IS_EUC_JISX0208

#define IS_EUC_JISX0208 (   h,
  l 
)    (IS_EUC_BYTE(h) && IS_EUC_BYTE(l))

Definition at line 44 of file nls_euc-jp.c.

◆ IS_EUC_UDC_HI

#define IS_EUC_UDC_HI (   h,
  l 
)    IS_EUC_UDC_LOW(h, l) /* G3 block */

Definition at line 48 of file nls_euc-jp.c.

◆ IS_EUC_UDC_LOW

#define IS_EUC_UDC_LOW (   h,
  l 
)
Value:
(((0xF5 <= (h)) && ((h) <= 0xFE)) \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
r l[0]
Definition: byte_order.h:167
#define IS_EUC_BYTE(c)
Definition: nls_euc-jp.c:43

Definition at line 46 of file nls_euc-jp.c.

◆ IS_SJIS_IBM

#define IS_SJIS_IBM (   h,
  l 
)
Value:
(((0xFA <= (h)) && ((h) <= 0xFC)) \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define IS_SJIS_LOW_BYTE(l)
Definition: nls_euc-jp.c:17
r l[0]
Definition: byte_order.h:167

Definition at line 27 of file nls_euc-jp.c.

◆ IS_SJIS_JISX0201KANA

#define IS_SJIS_JISX0201KANA (   c)    ((0xA1 <= (c)) && ((c) <= 0xDF))

Definition at line 22 of file nls_euc-jp.c.

◆ IS_SJIS_JISX0208

#define IS_SJIS_JISX0208 (   h,
  l 
)
Value:
((((0x81 <= (h)) && ((h) <= 0x9F)) \
|| ((0xE0 <= (h)) && ((h) <= 0xEA))) \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define IS_SJIS_LOW_BYTE(l)
Definition: nls_euc-jp.c:17
r l[0]
Definition: byte_order.h:167

Definition at line 19 of file nls_euc-jp.c.

◆ IS_SJIS_LOW_BYTE

#define IS_SJIS_LOW_BYTE (   l)    ((0x40 <= (l)) && ((l) <= 0xFC) && ((l) != 0x7F))

Definition at line 17 of file nls_euc-jp.c.

◆ IS_SJIS_NECIBM

#define IS_SJIS_NECIBM (   h,
  l 
)
Value:
(((0xED <= (h)) && ((h) <= 0xEE)) \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define IS_SJIS_LOW_BYTE(l)
Definition: nls_euc-jp.c:17
r l[0]
Definition: byte_order.h:167

Definition at line 29 of file nls_euc-jp.c.

◆ IS_SJIS_UDC_HI

#define IS_SJIS_UDC_HI (   h,
  l 
)
Value:
(((0xF5 <= (h)) && ((h) <= 0xF9)) \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define IS_SJIS_LOW_BYTE(l)
Definition: nls_euc-jp.c:17
r l[0]
Definition: byte_order.h:167

Definition at line 25 of file nls_euc-jp.c.

◆ IS_SJIS_UDC_LOW

#define IS_SJIS_UDC_LOW (   h,
  l 
)
Value:
(((0xF0 <= (h)) && ((h) <= 0xF4)) \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define IS_SJIS_LOW_BYTE(l)
Definition: nls_euc-jp.c:17
r l[0]
Definition: byte_order.h:167

Definition at line 23 of file nls_euc-jp.c.

◆ MAP_ELEMENT_OF

#define MAP_ELEMENT_OF (   map)    (sizeof(map) / sizeof(map[0]))

Definition at line 271 of file nls_euc-jp.c.

◆ MAP_EUC2SJIS

#define MAP_EUC2SJIS (   euc_hi,
  euc_lo,
  euc_p,
  sjis_hi,
  sjis_lo,
  sjis_p 
)
Value:
{ \
if ((euc_hi) & 1) { \
(sjis_hi) = (euc_hi) / 2 + ((sjis_p) - (euc_p) / 2); \
(sjis_lo) = (euc_lo) - ((euc_lo) >= 0xE0 ? 0x60 : 0x61); \
} else { \
(sjis_hi) = (euc_hi) / 2 + (((sjis_p) - (euc_p) / 2) - 1); \
(sjis_lo) = (euc_lo) - 2; \
} \
} while(0)

Definition at line 49 of file nls_euc-jp.c.

◆ MAP_SJIS2EUC

#define MAP_SJIS2EUC (   sjis_hi,
  sjis_lo,
  sjis_p,
  euc_hi,
  euc_lo,
  euc_p 
)
Value:
{ \
if ((sjis_lo) >= 0x9F) { \
(euc_hi) = (sjis_hi) * 2 - (((sjis_p) * 2 - (euc_p)) - 1); \
(euc_lo) = (sjis_lo) + 2; \
} else { \
(euc_hi) = (sjis_hi) * 2 - ((sjis_p) * 2 - (euc_p)); \
(euc_lo) = (sjis_lo) + ((sjis_lo) >= 0x7F ? 0x60 : 0x61); \
} \
} while(0)

Definition at line 31 of file nls_euc-jp.c.

◆ SS2

#define SS2   (0x8E) /* Single Shift 2 */

Definition at line 41 of file nls_euc-jp.c.

◆ SS3

#define SS3   (0x8F) /* Single Shift 3 */

Definition at line 42 of file nls_euc-jp.c.

Function Documentation

◆ char2uni()

static int char2uni ( const unsigned char rawstring,
int  boundlen,
wchar_t uni 
)
static

Definition at line 483 of file nls_euc-jp.c.

485 {
486  unsigned char sjis_temp[2];
487  int euc_offset, n;
488 
489  if ( !p_nls )
490  return -EINVAL;
491  if (boundlen <= 0)
492  return -ENAMETOOLONG;
493 
494  /* translate EUC-JP into SJIS */
495  if (rawstring[0] > 0x7F) {
496  if (rawstring[0] == SS3) {
497  if (boundlen < 3)
498  return -EINVAL;
499  euc_offset = 3;
500 
501  if (IS_EUC_UDC_HI(rawstring[1], rawstring[2])) {
502  /* User defined characters half high */
503  MAP_EUC2SJIS(rawstring[1], rawstring[2], 0xF5,
504  sjis_temp[0], sjis_temp[1], 0xF5);
505  } else if (euc2sjisibm(sjis_temp,rawstring[1],rawstring[2])) {
506  /* IBM extended characters */
507  } else {
508  /* JIS X 0212 and Invalid characters*/
509  return -EINVAL;
510 
511  /* 'GETA' with SJIS coding */
512  /* sjis_temp[0] = 0x81; */
513  /* sjis_temp[1] = 0xAC; */
514  }
515  } else {
516  if (boundlen < 2)
517  return -EINVAL;
518  euc_offset = 2;
519 
520  if (IS_EUC_JISX0201KANA(rawstring[0], rawstring[1])) {
521  /* JIS X 0201 KANA */
522  sjis_temp[0] = rawstring[1];
523  sjis_temp[1] = 0x00;
524  } else if (IS_EUC_UDC_LOW(rawstring[0], rawstring[1])) {
525  /* User defined characters half low */
526  MAP_EUC2SJIS(rawstring[0], rawstring[1], 0xF5,
527  sjis_temp[0], sjis_temp[1], 0xF0);
528  } else if (IS_EUC_JISX0208(rawstring[0], rawstring[1])) {
529  /* JIS X 0208 (include NEC spesial characters) */
530  sjis_temp[0] = ((rawstring[0]-0x5f)/2) ^ 0xA0;
531  if (!(rawstring[0] & 1))
532  sjis_temp[1] = rawstring[1] - 0x02;
533  else if (rawstring[1] < 0xE0)
534  sjis_temp[1] = rawstring[1] - 0x61;
535  else
536  sjis_temp[1] = rawstring[1] - 0x60;
537  } else {
538  /* Invalid characters */
539  return -EINVAL;
540  }
541  }
542  } else {
543  euc_offset = 1;
544 
545  /* JIS X 0201 ROMAJI */
546  sjis_temp[0] = rawstring[0];
547  sjis_temp[1] = 0x00;
548  }
549 
550  if ( (n = p_nls->char2uni(sjis_temp, sizeof(sjis_temp), uni)) < 0)
551  return n;
552 
553  return euc_offset;
554 }
Definition: arc.h:39
GLdouble n
Definition: glext.h:7729
#define MAP_EUC2SJIS(euc_hi, euc_lo, euc_p, sjis_hi, sjis_lo, sjis_p)
Definition: nls_euc-jp.c:49
#define SS3
Definition: nls_euc-jp.c:42
#define IS_EUC_JISX0208(h, l)
Definition: nls_euc-jp.c:44
#define IS_EUC_UDC_HI(h, l)
Definition: nls_euc-jp.c:48
#define IS_EUC_UDC_LOW(h, l)
Definition: nls_euc-jp.c:46
#define IS_EUC_JISX0201KANA(h, l)
Definition: nls_euc-jp.c:45
static struct nls_table * p_nls
Definition: nls_euc-jp.c:15
static int euc2sjisibm(unsigned char *sjis, const unsigned char euc_hi, const unsigned char euc_lo)
Definition: nls_euc-jp.c:352

◆ euc2sjisibm()

static int euc2sjisibm ( unsigned char sjis,
const unsigned char  euc_hi,
const unsigned char  euc_lo 
)
inlinestatic

Definition at line 352 of file nls_euc-jp.c.

354 {
355  int n;
356 
357 #if 0
358  if ((euc_hi == 0xA2) && (euc_lo == 0xCC)) {
359  sjis[0] = 0xFA;
360  sjis[1] = 0x54;
361  return 2;
362  } else if ((euc_hi == 0xA2) && (euc_lo == 0xE8)) {
363  sjis[0] = 0xFA;
364  sjis[1] = 0x5B;
365  return 2;
366  }
367 #endif
368  if ((n = euc2sjisibm_g3upper(sjis, euc_hi, euc_lo))) {
369  return n;
370  } else if ((n = euc2sjisibm_jisx0212(sjis, euc_hi, euc_lo))) {
371  return n;
372  }
373 
374  return 0;
375 }
GLdouble n
Definition: glext.h:7729
unsigned char sjis[2]
Definition: nls_euc-jp.c:147
static int euc2sjisibm_jisx0212(unsigned char *sjis, const unsigned char euc_hi, const unsigned char euc_lo)
Definition: nls_euc-jp.c:306
static int euc2sjisibm_g3upper(unsigned char *sjis, const unsigned char euc_hi, const unsigned char euc_lo)
Definition: nls_euc-jp.c:332

Referenced by char2uni().

◆ euc2sjisibm_g3upper()

static int euc2sjisibm_g3upper ( unsigned char sjis,
const unsigned char  euc_hi,
const unsigned char  euc_lo 
)
inlinestatic

Definition at line 332 of file nls_euc-jp.c.

334 {
335  int index;
336 
337  if (euc_hi == 0xF3)
338  index = ((euc_hi << 8) | euc_lo) - 0xF3F3;
339  else
340  index = ((euc_hi << 8) | euc_lo) - 0xF4A1 + 12;
341 
343  return 0;
344 
347 
348  return 3;
349 }
static unsigned char euc2sjisibm_g3upper_map[][2]
Definition: nls_euc-jp.c:246
#define MAP_ELEMENT_OF(map)
Definition: nls_euc-jp.c:271
GLuint index
Definition: glext.h:6031
unsigned char sjis[2]
Definition: nls_euc-jp.c:147
#define index(s, c)
Definition: various.h:29

Referenced by euc2sjisibm().

◆ euc2sjisibm_jisx0212()

static int euc2sjisibm_jisx0212 ( unsigned char sjis,
const unsigned char  euc_hi,
const unsigned char  euc_lo 
)
inlinestatic

Definition at line 306 of file nls_euc-jp.c.

308 {
309  int index, min_index, max_index;
310  unsigned short euc;
311 
312  min_index = 0;
313  max_index = MAP_ELEMENT_OF(euc2sjisibm_jisx0212_map) - 1;
314  euc = (euc_hi << 8) | euc_lo;
315 
316  while (min_index <= max_index) {
317  index = (min_index + max_index) / 2;
319  max_index = index - 1;
320  else
321  min_index = index + 1;
323  sjis[0] = euc2sjisibm_jisx0212_map[index].sjis[0];
324  sjis[1] = euc2sjisibm_jisx0212_map[index].sjis[1];
325  return 3;
326  }
327  }
328  return 0;
329 }
static struct @678 euc2sjisibm_jisx0212_map[]
#define MAP_ELEMENT_OF(map)
Definition: nls_euc-jp.c:271
GLuint index
Definition: glext.h:6031
unsigned char sjis[2]
Definition: nls_euc-jp.c:147
#define index(s, c)
Definition: various.h:29
unsigned short euc
Definition: nls_euc-jp.c:146

Referenced by euc2sjisibm().

◆ exit_nls_euc_jp()

static void __exit exit_nls_euc_jp ( void  )
static

Definition at line 578 of file nls_euc-jp.c.

579 {
581  unload_nls(p_nls);
582 }
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185
void unload_nls(struct nls_table *)
Definition: nls_base.c:240
static struct nls_table * p_nls
Definition: nls_euc-jp.c:15

Referenced by Ext2UnloadAllNls(), and RfsdUnloadAllNls().

◆ init_nls_euc_jp()

static int __init init_nls_euc_jp ( void  )
static

Definition at line 565 of file nls_euc-jp.c.

566 {
567  p_nls = load_nls("cp932");
568 
569  if (p_nls) {
570  table.charset2upper = p_nls->charset2upper;
571  table.charset2lower = p_nls->charset2lower;
572  return register_nls(&table);
573  }
574 
575  return -EINVAL;
576 }
Definition: arc.h:39
static struct nls_table * p_nls
Definition: nls_euc-jp.c:15
int register_nls(struct nls_table *)
Definition: nls_base.c:162
struct nls_table * load_nls(char *)
Definition: nls_base.c:218

Referenced by Ext2LoadAllNls(), and RfsdLoadAllNls().

◆ sjisibm2euc()

static int sjisibm2euc ( unsigned char euc,
const unsigned char  sjis_hi,
const unsigned char  sjis_lo 
)
inlinestatic

Definition at line 286 of file nls_euc-jp.c.

288 {
289  int index;
290 
291  index = ((sjis_hi - 0xFA) * (0xFD - 0x40)) + (sjis_lo - 0x40);
293  sjisibm2euc_map[index][1])) {
294  euc[0] = sjisibm2euc_map[index][0];
295  euc[1] = sjisibm2euc_map[index][1];
296  return 2;
297  } else {
298  euc[0] = SS3;
299  euc[1] = sjisibm2euc_map[index][0];
300  euc[2] = sjisibm2euc_map[index][1];
301  return 3;
302  }
303 }
static unsigned char sjisibm2euc_map[][2]
Definition: nls_euc-jp.c:60
#define SS3
Definition: nls_euc-jp.c:42
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29
#define IS_EUC_IBM2JISX0208(h, l)
Definition: nls_euc-jp.c:141
unsigned short euc
Definition: nls_euc-jp.c:146

Referenced by uni2char().

◆ sjisnec2sjisibm()

static int sjisnec2sjisibm ( unsigned char sjisibm,
const unsigned char  sjisnec_hi,
const unsigned char  sjisnec_lo 
)
inlinestatic

Definition at line 378 of file nls_euc-jp.c.

381 {
382  int count;
383 
384  if (! IS_SJIS_NECIBM(sjisnec_hi, sjisnec_lo))
385  return 0;
386 
387  if ((sjisnec_hi == 0xEE) && (sjisnec_lo == 0xF9)) {
388  sjisibm[0] = 0x81;
389  sjisibm[1] = 0xCA;
390  return 2;
391  }
392 
393  if ((sjisnec_hi == 0xEE) && (sjisnec_lo >= 0xEF)) {
394  count = (sjisnec_hi << 8 | sjisnec_lo)
395  - (sjisnec_lo <= 0xF9 ? 0xEEEF : (0xEEEF - 10));
396  } else {
397  count = (sjisnec_hi - 0xED) * (0xFC - 0x40)
398  + (sjisnec_lo - 0x40) + (0x5C - 0x40);
399  if (sjisnec_lo >= 0x7F)
400  count--;
401  }
402 
403  sjisibm[0] = 0xFA + (count / (0xFC - 0x40));
404  sjisibm[1] = 0x40 + (count % (0xFC - 0x40));
405  if (sjisibm[1] >= 0x7F)
406  sjisibm[1]++;
407 
408  return 2;
409 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define IS_SJIS_NECIBM(h, l)
Definition: nls_euc-jp.c:29

Referenced by uni2char().

◆ uni2char()

static int uni2char ( const wchar_t  uni,
unsigned char out,
int  boundlen 
)
static

Definition at line 411 of file nls_euc-jp.c.

413 {
414  int n;
415 
416  if (!p_nls)
417  return -EINVAL;
418  if ((n = p_nls->uni2char(uni, out, boundlen)) < 0)
419  return n;
420 
421  /* translate SJIS into EUC-JP */
422  if (n == 1) {
423  if (IS_SJIS_JISX0201KANA(out[0])) {
424  /* JIS X 0201 KANA */
425  if (boundlen < 2)
426  return -ENAMETOOLONG;
427 
428  out[1] = out[0];
429  out[0] = SS2;
430  return 2;
431  }
432  } else if (n == 2) {
433  /* NEC/IBM extended characters to IBM extended characters */
434  sjisnec2sjisibm(out, out[0], out[1]);
435 
436  if (IS_SJIS_UDC_LOW(out[0], out[1])) {
437  /* User defined characters half low */
438  MAP_SJIS2EUC(out[0], out[1], 0xF0, out[0], out[1], 0xF5);
439  } else if (IS_SJIS_UDC_HI(out[0], out[1])) {
440  /* User defined characters half high */
441  unsigned char ch, cl;
442 
443  if (boundlen < 3)
444  return -ENAMETOOLONG;
445 
446  n = 3;
447  ch = out[0];
448  cl = out[1];
449  out[0] = SS3;
450  MAP_SJIS2EUC(ch, cl, 0xF5, out[1], out[2], 0xF5);
451  } else if (IS_SJIS_IBM(out[0], out[1])) {
452  /* IBM extended characters */
453  unsigned char euc[3], i;
454 
455  n = sjisibm2euc(euc, out[0], out[1]);
456  if (boundlen < n)
457  return -ENAMETOOLONG;
458  for (i = 0; i < n; i++)
459  out[i] = euc[i];
460  } else if (IS_SJIS_JISX0208(out[0], out[1])) {
461  /* JIS X 0208 (include NEC special characters) */
462  out[0] = (out[0]^0xA0)*2 + 0x5F;
463  if (out[1] > 0x9E)
464  out[0]++;
465 
466  if (out[1] < 0x7F)
467  out[1] = out[1] + 0x61;
468  else if (out[1] < 0x9F)
469  out[1] = out[1] + 0x60;
470  else
471  out[1] = out[1] + 0x02;
472  } else {
473  /* Invalid characters */
474  return -EINVAL;
475  }
476  }
477  else
478  return -EINVAL;
479 
480  return n;
481 }
#define IS_SJIS_JISX0201KANA(c)
Definition: nls_euc-jp.c:22
#define IS_SJIS_UDC_HI(h, l)
Definition: nls_euc-jp.c:25
Definition: arc.h:39
static int sjisibm2euc(unsigned char *euc, const unsigned char sjis_hi, const unsigned char sjis_lo)
Definition: nls_euc-jp.c:286
GLdouble n
Definition: glext.h:7729
#define MAP_SJIS2EUC(sjis_hi, sjis_lo, sjis_p, euc_hi, euc_lo, euc_p)
Definition: nls_euc-jp.c:31
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int sjisnec2sjisibm(unsigned char *sjisibm, const unsigned char sjisnec_hi, const unsigned char sjisnec_lo)
Definition: nls_euc-jp.c:378
#define SS2
Definition: nls_euc-jp.c:41
#define SS3
Definition: nls_euc-jp.c:42
static FILE * out
Definition: regtests2xml.c:44
static struct nls_table * p_nls
Definition: nls_euc-jp.c:15
#define IS_SJIS_IBM(h, l)
Definition: nls_euc-jp.c:27
unsigned short euc
Definition: nls_euc-jp.c:146
#define IS_SJIS_UDC_LOW(h, l)
Definition: nls_euc-jp.c:23
#define IS_SJIS_JISX0208(h, l)
Definition: nls_euc-jp.c:19

Variable Documentation

◆ euc

unsigned short euc

Definition at line 146 of file nls_euc-jp.c.

Referenced by euc2sjisibm_jisx0212(), sjisibm2euc(), and uni2char().

◆ euc2sjisibm_g3upper_map

unsigned char euc2sjisibm_g3upper_map[][2]
static
Initial value:
= {
{0xFA, 0x40}, {0xFA, 0x41}, {0xFA, 0x42}, {0xFA, 0x43}, {0xFA, 0x44},
{0xFA, 0x45}, {0xFA, 0x46}, {0xFA, 0x47}, {0xFA, 0x48}, {0xFA, 0x49},
{0xFA, 0x4A}, {0xFA, 0x4B}, {0xFA, 0x4C}, {0xFA, 0x4D}, {0xFA, 0x4E},
{0xFA, 0x4F}, {0xFA, 0x50}, {0xFA, 0x51}, {0xFA, 0x52}, {0xFA, 0x53},
{0xFA, 0x56}, {0xFA, 0x57}, {0xFA, 0x58}, {0xFA, 0x59}, {0xFA, 0x5A},
{0xFA, 0x62}, {0xFA, 0x6A}, {0xFA, 0x7C}, {0xFA, 0x83}, {0xFA, 0x8A},
{0xFA, 0x8B}, {0xFA, 0x90}, {0xFA, 0x92}, {0xFA, 0x96}, {0xFA, 0x9B},
{0xFA, 0x9C}, {0xFA, 0x9D}, {0xFA, 0xAA}, {0xFA, 0xAE}, {0xFA, 0xB0},
{0xFA, 0xB1}, {0xFA, 0xBA}, {0xFA, 0xBD}, {0xFA, 0xC1}, {0xFA, 0xCD},
{0xFA, 0xD0}, {0xFA, 0xD5}, {0xFA, 0xD8}, {0xFA, 0xE0}, {0xFA, 0xE5},
{0xFA, 0xE8}, {0xFA, 0xEA}, {0xFA, 0xEE}, {0xFA, 0xF2}, {0xFB, 0x43},
{0xFB, 0x44}, {0xFB, 0x50}, {0xFB, 0x58}, {0xFB, 0x5E}, {0xFB, 0x6E},
{0xFB, 0x70}, {0xFB, 0x72}, {0xFB, 0x75}, {0xFB, 0x7C}, {0xFB, 0x7D},
{0xFB, 0x7E}, {0xFB, 0x80}, {0xFB, 0x82}, {0xFB, 0x85}, {0xFB, 0x86},
{0xFB, 0x89}, {0xFB, 0x8D}, {0xFB, 0x8E}, {0xFB, 0x92}, {0xFB, 0x94},
{0xFB, 0x9D}, {0xFB, 0x9E}, {0xFB, 0x9F}, {0xFB, 0xA0}, {0xFB, 0xA1},
{0xFB, 0xA9}, {0xFB, 0xAC}, {0xFB, 0xAE}, {0xFB, 0xB0}, {0xFB, 0xB1},
{0xFB, 0xB3}, {0xFB, 0xB4}, {0xFB, 0xB6}, {0xFB, 0xB7}, {0xFB, 0xB8},
{0xFB, 0xD3}, {0xFB, 0xDA}, {0xFB, 0xE8}, {0xFB, 0xE9}, {0xFB, 0xEA},
{0xFB, 0xEE}, {0xFB, 0xF0}, {0xFB, 0xF2}, {0xFB, 0xF6}, {0xFB, 0xF7},
{0xFB, 0xF9}, {0xFB, 0xFA}, {0xFB, 0xFC}, {0xFC, 0x42}, {0xFC, 0x49},
{0xFC, 0x4B},
}

Definition at line 246 of file nls_euc-jp.c.

Referenced by euc2sjisibm_g3upper().

◆ euc2sjisibm_jisx0212_map

struct { ... } euc2sjisibm_jisx0212_map[]

Referenced by euc2sjisibm_jisx0212().

◆ p_nls

struct nls_table* p_nls
static

Definition at line 15 of file nls_euc-jp.c.

Referenced by char2uni(), exit_nls_euc_jp(), init_nls_euc_jp(), and uni2char().

◆ sjis

unsigned char sjis[2]

Definition at line 147 of file nls_euc-jp.c.

Referenced by euc2sjisibm(), euc2sjisibm_g3upper(), and euc2sjisibm_jisx0212().

◆ sjisibm2euc_map

unsigned char sjisibm2euc_map[][2]
static

Definition at line 60 of file nls_euc-jp.c.

Referenced by sjisibm2euc().

◆ table

Initial value:
= {
"euc-jp",
0,
0, 0,
}
#define THIS_MODULE
Definition: module.h:267
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_euc-jp.c:483
static int uni2char(const wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_euc-jp.c:411

Definition at line 556 of file nls_euc-jp.c.