ReactOS 0.4.15-dev-7842-g558ab78
nls_cp737.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_cp737.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_cp737 (void)
 
static void __exit exit_nls_cp737 (void)
 

Variables

static wchar_t charset2uni [256]
 
static unsigned char page00 [256]
 
static unsigned char page03 [256]
 
static unsigned char page20 [256]
 
static unsigned char page22 [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 321 of file nls_cp737.c.

322{
323 *uni = charset2uni[*rawstring];
324 if (*uni == 0x0000)
325 return -EINVAL;
326 return 1;
327}
#define EINVAL
Definition: acclib.h:90
static wchar_t charset2uni[256]
Definition: nls_cp737.c:16

◆ exit_nls_cp737()

static void __exit exit_nls_cp737 ( void  )
static

Definition at line 344 of file nls_cp737.c.

345{
347}
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

Referenced by Ext2UnloadAllNls().

◆ init_nls_cp737()

static int __init init_nls_cp737 ( void  )
static

Definition at line 339 of file nls_cp737.c.

340{
341 return register_nls(&table);
342}
int register_nls(struct nls_table *)
Definition: nls_base.c:162

Referenced by Ext2LoadAllNls().

◆ uni2char()

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

Definition at line 304 of file nls_cp737.c.

305{
306 unsigned char *uni2charset;
307 unsigned char cl = uni & 0x00ff;
308 unsigned char ch = (uni & 0xff00) >> 8;
309
310 if (boundlen <= 0)
311 return -ENAMETOOLONG;
312
313 uni2charset = page_uni2charset[ch];
314 if (uni2charset && uni2charset[cl])
315 out[0] = uni2charset[cl];
316 else
317 return -EINVAL;
318 return 1;
319}
static unsigned char * page_uni2charset[256]
Definition: nls_cp737.c:224
static FILE * out
Definition: regtests2xml.c:44
#define ENAMETOOLONG
Definition: errno.h:55

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 232 of file nls_cp737.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 16 of file nls_cp737.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 268 of file nls_cp737.c.

◆ page00

unsigned char page00[256]
static

Definition at line 99 of file nls_cp737.c.

◆ page03

unsigned char page03[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, 0xea, 0x00,
0xeb, 0xec, 0xed, 0x00, 0xee, 0x00, 0xef, 0xf0,
0x00, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86,
0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e,
0x8f, 0x90, 0x00, 0x91, 0x92, 0x93, 0x94, 0x95,
0x96, 0x97, 0xf4, 0xf5, 0xe1, 0xe2, 0xe3, 0xe5,
0x00, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
0xa7, 0xa8, 0xaa, 0xa9, 0xab, 0xac, 0xad, 0xae,
0xaf, 0xe0, 0xe4, 0xe8, 0xe6, 0xe7, 0xe9, 0x00,
}

Definition at line 134 of file nls_cp737.c.

◆ page20

unsigned char page20[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, 0xfc,
}

Definition at line 164 of file nls_cp737.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, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00,
}

Definition at line 183 of file nls_cp737.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, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb,
0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7,
0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf,
0xd0, 0xca, 0xd8, 0xd7, 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, 0xdd, 0x00, 0x00, 0x00,
0xde, 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 199 of file nls_cp737.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
#define NULL
Definition: types.h:112
static unsigned char page03[256]
Definition: nls_cp737.c:134
static unsigned char page22[256]
Definition: nls_cp737.c:183
static unsigned char page20[256]
Definition: nls_cp737.c:164
static unsigned char page25[256]
Definition: nls_cp737.c:199
static unsigned char page00[256]
Definition: nls_cp737.c:99

Definition at line 224 of file nls_cp737.c.

Referenced by uni2char().

◆ table

Initial value:
= {
"cp737",
0,
}
#define THIS_MODULE
Definition: module.h:269
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_cp737.c:321
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_cp737.c:304
static unsigned char charset2lower[256]
Definition: nls_cp737.c:232
static unsigned char charset2upper[256]
Definition: nls_cp737.c:268

Definition at line 329 of file nls_cp737.c.