ReactOS  0.4.13-dev-687-g023794c
nls_cp1255.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_cp1255.c:

Go to the source code of this file.

Functions

static int uni2char (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_cp1255 (void)
 
static void __exit exit_nls_cp1255 (void)
 

Variables

static wchar_t charset2uni [256]
 
static unsigned char page00 [256]
 
static unsigned char page01 [256]
 
static unsigned char page02 [256]
 
static unsigned char page05 [256]
 
static unsigned char page20 [256]
 
static unsigned char page21 [256]
 
static unsigned charpage_uni2charset [256]
 
static unsigned char charset2lower [256]
 
static unsigned char charset2upper [256]
 
static struct nls_table table
 

Function Documentation

◆ char2uni()

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

Definition at line 353 of file nls_cp1255.c.

354 {
355  *uni = charset2uni[*rawstring];
356  if (*uni == 0x0000)
357  return -EINVAL;
358  return 1;
359 }
Definition: arc.h:39
static wchar_t charset2uni[256]
Definition: nls_cp1255.c:14

◆ exit_nls_cp1255()

static void __exit exit_nls_cp1255 ( void  )
static

Definition at line 375 of file nls_cp1255.c.

376 {
378 }
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

◆ init_nls_cp1255()

static int __init init_nls_cp1255 ( void  )
static

Definition at line 370 of file nls_cp1255.c.

371 {
372  return register_nls(&table);
373 }
int register_nls(struct nls_table *)
Definition: nls_base.c:162

◆ uni2char()

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

Definition at line 336 of file nls_cp1255.c.

337 {
338  unsigned char *uni2charset;
339  unsigned char cl = uni & 0x00ff;
340  unsigned char ch = (uni & 0xff00) >> 8;
341 
342  if (boundlen <= 0)
343  return -ENAMETOOLONG;
344 
345  uni2charset = page_uni2charset[ch];
346  if (uni2charset && uni2charset[cl])
347  out[0] = uni2charset[cl];
348  else
349  return -EINVAL;
350  return 1;
351 }
static unsigned char * page_uni2charset[256]
Definition: nls_cp1255.c:256
Definition: arc.h:39
static FILE * out
Definition: regtests2xml.c:44

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 264 of file nls_cp1255.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 14 of file nls_cp1255.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 300 of file nls_cp1255.c.

◆ page00

unsigned char page00[256]
static

Definition at line 97 of file nls_cp1255.c.

◆ page01

unsigned char page01[256]
static
Initial value:
= {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 132 of file nls_cp1255.c.

◆ page02

unsigned char page02[256]
static

Definition at line 155 of file nls_cp1255.c.

◆ page05

unsigned char page05[256]
static

Definition at line 187 of file nls_cp1255.c.

◆ page20

unsigned char page20[256]
static
Initial value:
= {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xfe,
0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00,
0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00,
0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xa4, 0x00, 0x80, 0x00, 0x00, 0x00,
}

Definition at line 222 of file nls_cp1255.c.

◆ page21

unsigned char page21[256]
static
Initial value:
= {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 248 of file nls_cp1255.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
static unsigned char page02[256]
Definition: nls_cp1255.c:155
smooth NULL
Definition: ftsmooth.c:416
static unsigned char page05[256]
Definition: nls_cp1255.c:187
static unsigned char page01[256]
Definition: nls_cp1255.c:132
static unsigned char page20[256]
Definition: nls_cp1255.c:222
static unsigned char page00[256]
Definition: nls_cp1255.c:97
static unsigned char page21[256]
Definition: nls_cp1255.c:248

Definition at line 256 of file nls_cp1255.c.

Referenced by uni2char().

◆ table

Initial value:
= {
"cp1255",
}
static unsigned char charset2upper[256]
Definition: nls_cp1255.c:300
static unsigned char charset2lower[256]
Definition: nls_cp1255.c:264
#define THIS_MODULE
Definition: module.h:267
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_cp1255.c:353
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_cp1255.c:336

Definition at line 361 of file nls_cp1255.c.