ReactOS 0.4.16-dev-92-g0c2cdca
nls_utf8.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_utf8.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_utf8 (void)
 
static void __exit exit_nls_utf8 (void)
 

Variables

static unsigned char identity [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 25 of file nls_utf8.c.

26{
27 int n;
28
29 if ( (n = utf8_mbtowc(uni, rawstring, boundlen)) == -1) {
30 *uni = 0x003f; /* ? */
31 n = -EINVAL;
32 }
33 return n;
34}
#define EINVAL
Definition: acclib.h:90
GLdouble n
Definition: glext.h:7729
int utf8_mbtowc(wchar_t *, const __u8 *, int)
Definition: nls_base.c:49

◆ exit_nls_utf8()

static void __exit exit_nls_utf8 ( void  )
static

Definition at line 55 of file nls_utf8.c.

56{
58}
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185

Referenced by Ext2UnloadAllNls().

◆ init_nls_utf8()

static int __init init_nls_utf8 ( void  )
static

Definition at line 46 of file nls_utf8.c.

47{
48 int i;
49 for (i=0; i<256; i++)
50 identity[i] = (unsigned char) i;
51
52 return register_nls(&table);
53}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
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 14 of file nls_utf8.c.

15{
16 int n;
17
18 if ( (n = utf8_wctomb(out, uni, boundlen)) == -1) {
19 *out = '?';
20 return -EINVAL;
21 }
22 return n;
23}
int utf8_wctomb(__u8 *, wchar_t, int)
Definition: nls_base.c:108
static FILE * out
Definition: regtests2xml.c:44

Variable Documentation

◆ identity

unsigned char identity[256]
static

Definition at line 12 of file nls_utf8.c.

◆ table

Initial value:
= {
"utf8",
0,
}
#define THIS_MODULE
Definition: module.h:269
static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: nls_utf8.c:25
static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
Definition: nls_utf8.c:14
static unsigned char identity[256]
Definition: nls_utf8.c:12

Definition at line 36 of file nls_utf8.c.