ReactOS  0.4.13-dev-698-g77671f0
nls_koi8-r.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_koi8-r.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_koi8_r (void)
 
static void __exit exit_nls_koi8_r (void)
 

Variables

static wchar_t charset2uni [256]
 
static unsigned char page00 [256]
 
static unsigned char page04 [256]
 
static unsigned char page22 [256]
 
static unsigned char page23 [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 294 of file nls_koi8-r.c.

295 {
296  *uni = charset2uni[*rawstring];
297  if (*uni == 0x0000)
298  return -EINVAL;
299  return 1;
300 }
Definition: arc.h:39
static wchar_t charset2uni[256]
Definition: nls_koi8-r.c:16

◆ exit_nls_koi8_r()

static void __exit exit_nls_koi8_r ( void  )
static

Definition at line 316 of file nls_koi8-r.c.

317 {
319 }
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

◆ init_nls_koi8_r()

static int __init init_nls_koi8_r ( void  )
static

Definition at line 311 of file nls_koi8-r.c.

312 {
313  return register_nls(&table);
314 }
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 277 of file nls_koi8-r.c.

278 {
279  unsigned char *uni2charset;
280  unsigned char cl = uni & 0x00ff;
281  unsigned char ch = (uni & 0xff00) >> 8;
282 
283  if (boundlen <= 0)
284  return -ENAMETOOLONG;
285 
286  uni2charset = page_uni2charset[ch];
287  if (uni2charset && uni2charset[cl])
288  out[0] = uni2charset[cl];
289  else
290  return -EINVAL;
291  return 1;
292 }
Definition: arc.h:39
static FILE * out
Definition: regtests2xml.c:44
static unsigned char * page_uni2charset[256]
Definition: nls_koi8-r.c:197

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 205 of file nls_koi8-r.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 16 of file nls_koi8-r.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 241 of file nls_koi8-r.c.

◆ page00

unsigned char page00[256]
static

Definition at line 99 of file nls_koi8-r.c.

◆ page04

unsigned char page04[256]
static
Initial value:
= {
0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa,
0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0,
0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe,
0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1,
0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda,
0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde,
0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1,
0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 134 of file nls_koi8-r.c.

◆ page22

unsigned char page22[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, 0x95, 0x96, 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,
0x97, 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, 0x98, 0x99, 0x00, 0x00,
}

Definition at line 148 of file nls_koi8-r.c.

◆ page23

unsigned char page23[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,
0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 164 of file nls_koi8-r.c.

◆ page25

unsigned char page25[256]
static
Initial value:
= {
0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00,
0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00,
0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00,
0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00,
0x8f, 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 172 of file nls_koi8-r.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
static unsigned char page04[256]
Definition: nls_koi8-r.c:134
static unsigned char page25[256]
Definition: nls_koi8-r.c:172
static unsigned char page23[256]
Definition: nls_koi8-r.c:164
smooth NULL
Definition: ftsmooth.c:416
static unsigned char page00[256]
Definition: nls_koi8-r.c:99
static unsigned char page22[256]
Definition: nls_koi8-r.c:148

Definition at line 197 of file nls_koi8-r.c.

Referenced by uni2char().

◆ table

Initial value:
= {
"koi8-r",
}
#define THIS_MODULE
Definition: module.h:267
static unsigned char charset2upper[256]
Definition: nls_koi8-r.c:241
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_koi8-r.c:294
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_koi8-r.c:277
static unsigned char charset2lower[256]
Definition: nls_koi8-r.c:205

Definition at line 302 of file nls_koi8-r.c.