ReactOS 0.4.15-dev-7958-gcd0bb1a
nls_iso8859-13.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_iso8859-13.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_iso8859_13 (void)
 
static void __exit exit_nls_iso8859_13 (void)
 

Variables

static wchar_t charset2uni [256]
 
static unsigned char page00 [256]
 
static unsigned char page01 [256]
 
static unsigned char page20 [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 256 of file nls_iso8859-13.c.

257{
258 *uni = charset2uni[*rawstring];
259 if (*uni == 0x0000)
260 return -EINVAL;
261 return 1;
262}
#define EINVAL
Definition: acclib.h:90
static wchar_t charset2uni[256]

◆ exit_nls_iso8859_13()

static void __exit exit_nls_iso8859_13 ( void  )
static

Definition at line 279 of file nls_iso8859-13.c.

280{
282}
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

Referenced by Ext2UnloadAllNls().

◆ init_nls_iso8859_13()

static int __init init_nls_iso8859_13 ( void  )
static

Definition at line 274 of file nls_iso8859-13.c.

275{
276 return register_nls(&table);
277}
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 239 of file nls_iso8859-13.c.

240{
241 unsigned char *uni2charset;
242 unsigned char cl = uni & 0x00ff;
243 unsigned char ch = (uni & 0xff00) >> 8;
244
245 if (boundlen <= 0)
246 return -ENAMETOOLONG;
247
248 uni2charset = page_uni2charset[ch];
249 if (uni2charset && uni2charset[cl])
250 out[0] = uni2charset[cl];
251 else
252 return -EINVAL;
253 return 1;
254}
static unsigned char * page_uni2charset[256]
static FILE * out
Definition: regtests2xml.c:44
#define ENAMETOOLONG
Definition: errno.h:55

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 167 of file nls_iso8859-13.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 14 of file nls_iso8859-13.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 203 of file nls_iso8859-13.c.

◆ page00

unsigned char page00[256]
static

Definition at line 97 of file nls_iso8859-13.c.

◆ page01

unsigned char page01[256]
static
Initial value:
= {
0xc2, 0xe2, 0x00, 0x00, 0xc0, 0xe0, 0xc3, 0xe3,
0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0x00, 0x00,
0x00, 0x00, 0xc7, 0xe7, 0x00, 0x00, 0xcb, 0xeb,
0xc6, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xce, 0xee, 0x00, 0x00, 0xc1, 0xe1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xed,
0x00, 0x00, 0x00, 0xcf, 0xef, 0x00, 0x00, 0x00,
0x00, 0xd9, 0xf9, 0xd1, 0xf1, 0xd2, 0xf2, 0x00,
0x00, 0x00, 0x00, 0x00, 0xd4, 0xf4, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xba,
0x00, 0x00, 0xda, 0xfa, 0x00, 0x00, 0x00, 0x00,
0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xd8, 0xf8, 0x00, 0x00, 0x00, 0x00,
0x00, 0xca, 0xea, 0xdd, 0xfd, 0xde, 0xfe, 0x00,
}

Definition at line 133 of file nls_iso8859-13.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, 0xff, 0x00, 0x00, 0xb4, 0xa1, 0xa5, 0x00,
}

Definition at line 152 of file nls_iso8859-13.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
#define NULL
Definition: types.h:112
static unsigned char page01[256]
static unsigned char page20[256]
static unsigned char page00[256]

Definition at line 159 of file nls_iso8859-13.c.

Referenced by uni2char().

◆ table

Initial value:
= {
"iso8859-13",
0,
}
#define THIS_MODULE
Definition: module.h:269
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
static unsigned char charset2lower[256]
static unsigned char charset2upper[256]

Definition at line 264 of file nls_iso8859-13.c.