ReactOS  0.4.13-dev-651-g5dbc677
nls_iso8859-1.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-1.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_1 (void)
 
static void __exit exit_nls_iso8859_1 (void)
 

Variables

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

229 {
230  *uni = charset2uni[*rawstring];
231  if (*uni == 0x0000)
232  return -EINVAL;
233  return 1;
234 }
Definition: arc.h:39
static wchar_t charset2uni[256]
Definition: nls_iso8859-1.c:16

◆ exit_nls_iso8859_1()

static void __exit exit_nls_iso8859_1 ( void  )
static

Definition at line 251 of file nls_iso8859-1.c.

252 {
254 }
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

Referenced by Ext2UnloadAllNls(), and RfsdUnloadAllNls().

◆ init_nls_iso8859_1()

static int __init init_nls_iso8859_1 ( void  )
static

Definition at line 246 of file nls_iso8859-1.c.

247 {
248  return register_nls(&table);
249 }
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 211 of file nls_iso8859-1.c.

212 {
213  unsigned char *uni2charset;
214  unsigned char cl = uni & 0x00ff;
215  unsigned char ch = (uni & 0xff00) >> 8;
216 
217  if (boundlen <= 0)
218  return -ENAMETOOLONG;
219 
220  uni2charset = page_uni2charset[ch];
221  if (uni2charset && uni2charset[cl])
222  out[0] = uni2charset[cl];
223  else
224  return -EINVAL;
225  return 1;
226 }
Definition: arc.h:39
static unsigned char * page_uni2charset[256]
static FILE * out
Definition: regtests2xml.c:44

Variable Documentation

◆ charset2lower

unsigned char charset2lower[256]
static

Definition at line 139 of file nls_iso8859-1.c.

◆ charset2uni

wchar_t charset2uni[256]
static

Definition at line 16 of file nls_iso8859-1.c.

Referenced by char2uni().

◆ charset2upper

unsigned char charset2upper[256]
static

Definition at line 175 of file nls_iso8859-1.c.

◆ page00

unsigned char page00[256]
static

Definition at line 99 of file nls_iso8859-1.c.

◆ page_uni2charset

unsigned char* page_uni2charset[256]
static
Initial value:
= {
}
smooth NULL
Definition: ftsmooth.c:416
static unsigned char page00[256]
Definition: nls_iso8859-1.c:99

Definition at line 135 of file nls_iso8859-1.c.

Referenced by uni2char().

◆ table

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

Definition at line 236 of file nls_iso8859-1.c.