ReactOS 0.4.16-dev-297-gc569aee
nls_cp1250.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_cp1250.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_cp1250 (void)
 
static void __exit exit_nls_cp1250 (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 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 318 of file nls_cp1250.c.

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

◆ exit_nls_cp1250()

static void __exit exit_nls_cp1250 ( void  )
static

Definition at line 340 of file nls_cp1250.c.

341{
343}
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

◆ init_nls_cp1250()

static int __init init_nls_cp1250 ( void  )
static

Definition at line 336 of file nls_cp1250.c.

337{
338 return register_nls(&table);
339}
int register_nls(struct nls_table *)
Definition: nls_base.c:162

Referenced by Ext2LoadAllNls(), and Ext2UnloadAllNls().

◆ uni2char()

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

Definition at line 301 of file nls_cp1250.c.

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

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 229 of file nls_cp1250.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 16 of file nls_cp1250.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 265 of file nls_cp1250.c.

◆ page00

unsigned char page00[256]
static

Definition at line 99 of file nls_cp1250.c.

◆ page01

unsigned char page01[256]
static
Initial value:
= {
0x00, 0x00, 0xc3, 0xe3, 0xa5, 0xb9, 0xc6, 0xe6,
0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef,
0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xca, 0xea, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc5, 0xe5, 0x00, 0x00, 0xbc, 0xbe, 0x00,
0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2,
0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00,
0xd8, 0xf8, 0x8c, 0x9c, 0x00, 0x00, 0xaa, 0xba,
0x8a, 0x9a, 0xde, 0xfe, 0x8d, 0x9d, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9,
0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x8f, 0x9f, 0xaf, 0xbf, 0x8e, 0x9e, 0x00,
}

Definition at line 135 of file nls_cp1250.c.

◆ page02

unsigned char page02[256]
static

Definition at line 155 of file nls_cp1250.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, 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, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
}

Definition at line 187 of file nls_cp1250.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, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 213 of file nls_cp1250.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
#define NULL
Definition: types.h:112
static unsigned char page21[256]
Definition: nls_cp1250.c:213
static unsigned char page01[256]
Definition: nls_cp1250.c:135
static unsigned char page02[256]
Definition: nls_cp1250.c:155
static unsigned char page20[256]
Definition: nls_cp1250.c:187
static unsigned char page00[256]
Definition: nls_cp1250.c:99

Definition at line 221 of file nls_cp1250.c.

Referenced by uni2char().

◆ table

Initial value:
= {
"cp1250",
0,
}
#define THIS_MODULE
Definition: module.h:269
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_cp1250.c:318
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_cp1250.c:301
static unsigned char charset2lower[256]
Definition: nls_cp1250.c:229
static unsigned char charset2upper[256]
Definition: nls_cp1250.c:265

Definition at line 326 of file nls_cp1250.c.