ReactOS  0.4.14-dev-77-gd9e7c48
nls_cp857.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_cp857.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_cp857 (void)
 
static void __exit exit_nls_cp857 (void)
 

Variables

static wchar_t charset2uni [256]
 
static unsigned char page00 [256]
 
static unsigned char page01 [256]
 
static unsigned char page25 [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 272 of file nls_cp857.c.

273 {
274  *uni = charset2uni[*rawstring];
275  if (*uni == 0x0000)
276  return -EINVAL;
277  return 1;
278 }
static wchar_t charset2uni[256]
Definition: nls_cp857.c:16
Definition: arc.h:39

◆ exit_nls_cp857()

static void __exit exit_nls_cp857 ( void  )
static

Definition at line 295 of file nls_cp857.c.

296 {
298 }
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

Referenced by Ext2UnloadAllNls(), and RfsdUnloadAllNls().

◆ init_nls_cp857()

static int __init init_nls_cp857 ( void  )
static

Definition at line 290 of file nls_cp857.c.

291 {
292  return register_nls(&table);
293 }
int register_nls(struct nls_table *)
Definition: nls_base.c:162

Referenced by Ext2LoadAllNls(), and RfsdLoadAllNls().

◆ uni2char()

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

Definition at line 255 of file nls_cp857.c.

256 {
257  unsigned char *uni2charset;
258  unsigned char cl = uni & 0x00ff;
259  unsigned char ch = (uni & 0xff00) >> 8;
260 
261  if (boundlen <= 0)
262  return -ENAMETOOLONG;
263 
264  uni2charset = page_uni2charset[ch];
265  if (uni2charset && uni2charset[cl])
266  out[0] = uni2charset[cl];
267  else
268  return -EINVAL;
269  return 1;
270 }
Definition: arc.h:39
static FILE * out
Definition: regtests2xml.c:44
static unsigned char * page_uni2charset[256]
Definition: nls_cp857.c:175

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 183 of file nls_cp857.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 16 of file nls_cp857.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 219 of file nls_cp857.c.

◆ page00

unsigned char page00[256]
static

Definition at line 99 of file nls_cp857.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, 0xa6, 0xa7,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x98, 0x8d, 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, 0x9e, 0x9f,
}

Definition at line 135 of file nls_cp857.c.

◆ page25

unsigned char page25[256]
static
Initial value:
= {
0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00,
0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb,
0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00,
0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00,
0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00,
0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 150 of file nls_cp857.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
static unsigned char page25[256]
Definition: nls_cp857.c:150
static unsigned char page01[256]
Definition: nls_cp857.c:135
static unsigned char page00[256]
Definition: nls_cp857.c:99
smooth NULL
Definition: ftsmooth.c:416

Definition at line 175 of file nls_cp857.c.

Referenced by uni2char().

◆ table

Initial value:
= {
"cp857",
0,
}
static unsigned char charset2upper[256]
Definition: nls_cp857.c:219
#define THIS_MODULE
Definition: module.h:267
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_cp857.c:272
static unsigned char charset2lower[256]
Definition: nls_cp857.c:183
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_cp857.c:255

Definition at line 280 of file nls_cp857.c.