OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [fs/] [nls.c] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 * linux/fs/nls.c
3
 *
4
 * Native language support--charsets and unicode translations.
5
 * By Gordon Chaffee 1996, 1997
6
 *
7
 */
8
#ifndef _LINUX_FS_NLS_C
9
#define _LINUX_FS_NLS_C
10
 
11
#define ASC_LINUX_VERSION(V, P, S)      (((V) * 65536) + ((P) * 256) + (S))
12
#include <linux/version.h>
13
#include <linux/module.h>
14
#include <linux/string.h>
15
#include <linux/config.h>
16
#include <linux/nls.h>
17
#include <linux/malloc.h>
18
#ifdef CONFIG_KERNELD
19
#include <linux/kerneld.h>
20
#endif
21
#include <asm/byteorder.h>
22
 
23
static struct nls_table *tables = (struct nls_table *) NULL;
24
 
25
/*
26
 * Sample implementation from Unicode home page.
27
 * http://www.stonehand.com/unicode/standard/fss-utf.html
28
 */
29
struct utf8_table {
30
        int     cmask;
31
        int     cval;
32
        int     shift;
33
        long    lmask;
34
        long    lval;
35
};
36
 
37
static struct utf8_table utf8_table[] =
38
{
39
    {0x80,  0x00,   0*6,    0x7F,           0,         /* 1 byte sequence */},
40
    {0xE0,  0xC0,   1*6,    0x7FF,          0x80,      /* 2 byte sequence */},
41
    {0xF0,  0xE0,   2*6,    0xFFFF,         0x800,     /* 3 byte sequence */},
42
    {0xF8,  0xF0,   3*6,    0x1FFFFF,       0x10000,   /* 4 byte sequence */},
43
    {0xFC,  0xF8,   4*6,    0x3FFFFFF,      0x200000,  /* 5 byte sequence */},
44
    {0xFE,  0xFC,   5*6,    0x7FFFFFFF,     0x4000000, /* 6 byte sequence */},
45
    {0,                                                 /* end of table    */}
46
};
47
 
48
int
49
utf8_mbtowc(__u16 *p, const __u8 *s, int n)
50
{
51
        long l;
52
        int c0, c, nc;
53
        struct utf8_table *t;
54
 
55
        printk("utf8_mbtowc\n");
56
        nc = 0;
57
        c0 = *s;
58
        l = c0;
59
        for (t = utf8_table; t->cmask; t++) {
60
                nc++;
61
                if ((c0 & t->cmask) == t->cval) {
62
                        l &= t->lmask;
63
                        if (l < t->lval)
64
                                return -1;
65
                        *p = l;
66
                        return nc;
67
                }
68
                if (n <= nc)
69
                        return -1;
70
                s++;
71
                c = (*s ^ 0x80) & 0xFF;
72
                if (c & 0xC0)
73
                        return -1;
74
                l = (l << 6) | c;
75
        }
76
        return -1;
77
}
78
 
79
int
80
utf8_mbstowcs(__u16 *pwcs, const __u8 *s, int n)
81
{
82
        __u16 *op;
83
        const __u8 *ip;
84
        int size;
85
 
86
        printk("\nutf8_mbstowcs: n=%d\n", n);
87
        op = pwcs;
88
        ip = s;
89
        while (*ip && n > 0) {
90
                printk(" %02x", *ip);
91
                if (*ip & 0x80) {
92
                        size = utf8_mbtowc(op, ip, n);
93
                        if (size == -1) {
94
                                /* Ignore character and move on */
95
                                ip++;
96
                                n--;
97
                        } else {
98
                                op += size;
99
                                ip += size;
100
                                n -= size;
101
                        }
102
                } else {
103
                        *op++ = *ip++;
104
                }
105
        }
106
        return (op - pwcs);
107
}
108
 
109
int
110
utf8_wctomb(__u8 *s, __u16 wc, int maxlen)
111
{
112
        long l;
113
        int c, nc;
114
        struct utf8_table *t;
115
 
116
        if (s == 0)
117
                return 0;
118
 
119
        l = wc;
120
        nc = 0;
121
        for (t = utf8_table; t->cmask && maxlen; t++, maxlen--) {
122
                nc++;
123
                if (l <= t->lmask) {
124
                        c = t->shift;
125
                        *s = t->cval | (l >> c);
126
                        while (c > 0) {
127
                                c -= 6;
128
                                s++;
129
                                *s = 0x80 | ((l >> c) & 0x3F);
130
                        }
131
                        return nc;
132
                }
133
        }
134
        return -1;
135
}
136
 
137
int
138
utf8_wcstombs(__u8 *s, const __u16 *pwcs, int maxlen)
139
{
140
        const __u16 *ip;
141
        __u8 *op;
142
        int size;
143
 
144
        op = s;
145
        ip = pwcs;
146
        while (*ip && maxlen > 0) {
147
                if (*ip > 0x7f) {
148
                        size = utf8_wctomb(op, *ip, maxlen);
149
                        if (size == -1) {
150
                                /* Ignore character and move on */
151
                                maxlen--;
152
                        } else {
153
                                op += size;
154
                                maxlen -= size;
155
                        }
156
                } else {
157
                        *op++ = (__u8) *ip;
158
                }
159
                ip++;
160
        }
161
        return (op - s);
162
}
163
 
164
int register_nls(struct nls_table * nls)
165
{
166
        struct nls_table ** tmp = &tables;
167
 
168
        if (!nls)
169
                return -EINVAL;
170
        if (nls->next)
171
                return -EBUSY;
172
        while (*tmp) {
173
                if (nls == *tmp) {
174
                        return -EBUSY;
175
                }
176
                tmp = &(*tmp)->next;
177
        }
178
        nls->next = tables;
179
        tables = nls;
180
        return 0;
181
}
182
 
183
int unregister_nls(struct nls_table * nls)
184
{
185
        struct nls_table ** tmp = &tables;
186
 
187
        while (*tmp) {
188
                if (nls == *tmp) {
189
                        *tmp = nls->next;
190
                        return 0;
191
                }
192
                tmp = &(*tmp)->next;
193
        }
194
        return -EINVAL;
195
}
196
 
197
struct nls_table *find_nls(char *charset)
198
{
199
        struct nls_table *nls = tables;
200
        while (nls) {
201
                if (! strcmp(nls->charset, charset))
202
                        return nls;
203
                nls = nls->next;
204
        }
205
        return NULL;
206
}
207
 
208
struct nls_table *load_nls(char *charset)
209
{
210
        struct nls_table *nls;
211
#ifdef CONFIG_KERNELD
212
        char buf[40];
213
        int ret;
214
#endif
215
 
216
        nls = find_nls(charset);
217
        if (nls) {
218
                nls->inc_use_count();
219
                return nls;
220
        }
221
 
222
#ifndef CONFIG_KERNELD
223
        return NULL;
224
#else
225
        if (strlen(charset) > sizeof(buf) - sizeof("nls_")) {
226
                printk("Unable to load NLS charset %s: name too long\n", charset);
227
                return NULL;
228
        }
229
 
230
        sprintf(buf, "nls_%s", charset);
231
        ret = strlen(buf);
232
 
233
        /* Hack to get around genksyms problem */
234
        if (buf[ret-2] == '-')
235
                buf[ret-2] = '_';
236
        if (buf[ret-3] == '-')
237
                buf[ret-3] = '_';
238
 
239
        ret = request_module(buf);
240
        if (ret != 0) {
241
                printk("Unable to load NLS charset %s(%s)\n", charset, buf);
242
                return NULL;
243
        }
244
        nls = find_nls(charset);
245
        if (nls) {
246
                nls->inc_use_count();
247
        }
248
        return nls;
249
#endif
250
}
251
 
252
void unload_nls(struct nls_table *nls)
253
{
254
        nls->dec_use_count();
255
}
256
 
257
struct nls_unicode charset2uni[256] = {
258
        /* 0x00*/
259
        {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
260
        {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
261
        {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
262
        {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
263
        /* 0x10*/
264
        {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
265
        {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
266
        {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
267
        {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
268
        /* 0x20*/
269
        {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
270
        {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
271
        {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
272
        {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
273
        /* 0x30*/
274
        {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
275
        {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
276
        {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
277
        {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
278
        /* 0x40*/
279
        {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
280
        {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
281
        {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
282
        {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
283
        /* 0x50*/
284
        {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
285
        {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
286
        {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
287
        {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
288
        /* 0x60*/
289
        {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
290
        {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
291
        {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
292
        {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
293
        /* 0x70*/
294
        {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
295
        {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
296
        {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
297
        {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
298
        /* 0x80*/
299
        {0x80, 0x00}, {0x81, 0x00}, {0x82, 0x00}, {0x83, 0x00},
300
        {0x84, 0x00}, {0x85, 0x00}, {0x86, 0x00}, {0x87, 0x00},
301
        {0x88, 0x00}, {0x89, 0x00}, {0x8a, 0x00}, {0x8b, 0x00},
302
        {0x8c, 0x00}, {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0x00},
303
        /* 0x90*/
304
        {0x90, 0x00}, {0x91, 0x00}, {0x92, 0x00}, {0x93, 0x00},
305
        {0x94, 0x00}, {0x95, 0x00}, {0x96, 0x00}, {0x97, 0x00},
306
        {0x98, 0x00}, {0x99, 0x00}, {0x9a, 0x00}, {0x9b, 0x00},
307
        {0x9c, 0x00}, {0x9d, 0x00}, {0x9e, 0x00}, {0x9f, 0x00},
308
        /* 0xa0*/
309
        {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
310
        {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
311
        {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
312
        {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
313
        /* 0xb0*/
314
        {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
315
        {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
316
        {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
317
        {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
318
        /* 0xc0*/
319
        {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
320
        {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
321
        {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
322
        {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
323
        /* 0xd0*/
324
        {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
325
        {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
326
        {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
327
        {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00},
328
        /* 0xe0*/
329
        {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
330
        {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
331
        {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
332
        {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
333
        /* 0xf0*/
334
        {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
335
        {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
336
        {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
337
        {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00},
338
};
339
 
340
static unsigned char page00[256] = {
341
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
342
        0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
343
        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
344
        0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
345
        0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
346
        0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
347
        0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
348
        0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
349
        0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
350
        0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
351
        0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
352
        0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
353
        0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
354
        0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
355
        0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
356
        0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
357
 
358
        0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
359
        0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
360
        0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
361
        0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
362
        0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
363
        0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
364
        0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
365
        0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
366
        0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
367
        0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
368
        0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
369
        0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
370
        0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
371
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
372
        0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
373
        0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
374
};
375
 
376
static unsigned char *page_uni2charset[256] = {
377
        page00
378
};
379
 
380
 
381
void inc_use_count(void)
382
{
383
}
384
 
385
void dec_use_count(void)
386
{
387
}
388
 
389
static struct nls_table default_table = {
390
        "default",
391
        page_uni2charset,
392
        charset2uni,
393
        inc_use_count,
394
        dec_use_count,
395
        NULL
396
};
397
 
398
 
399
 
400
/* Returns a simple default translation table */
401
struct nls_table *load_nls_default(void)
402
{
403
        return &default_table;
404
}
405
 
406
#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
407
#define X(sym) EXPORT_SYMBOL(sym);
408
#define X_PUNCT ;
409
#else
410
#define X_PUNCT ,
411
static struct symbol_table nls_syms = {
412
#include <linux/symtab_begin.h>
413
#endif
414
X(register_nls) X_PUNCT
415
X(unregister_nls) X_PUNCT
416
X(unload_nls) X_PUNCT
417
X(find_nls) X_PUNCT
418
X(load_nls) X_PUNCT
419
X(load_nls_default) X_PUNCT
420
X(utf8_mbtowc) X_PUNCT
421
X(utf8_mbstowcs) X_PUNCT
422
X(utf8_wctomb) X_PUNCT
423
X(utf8_wcstombs) X_PUNCT
424
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0)
425
#include <linux/symtab_end.h>
426
};
427
#endif
428
 
429
int init_nls(void)
430
{
431
#ifdef CONFIG_NLS_ISO8859_1
432
        init_nls_iso8859_1();
433
#endif
434
#ifdef CONFIG_NLS_ISO8859_2
435
        init_nls_iso8859_2();
436
#endif
437
#ifdef CONFIG_NLS_ISO8859_3
438
        init_nls_iso8859_3();
439
#endif
440
#ifdef CONFIG_NLS_ISO8859_4
441
        init_nls_iso8859_4();
442
#endif
443
#ifdef CONFIG_NLS_ISO8859_5
444
        init_nls_iso8859_5();
445
#endif
446
#ifdef CONFIG_NLS_ISO8859_6
447
        init_nls_iso8859_6();
448
#endif
449
#ifdef CONFIG_NLS_ISO8859_7
450
        init_nls_iso8859_7();
451
#endif
452
#ifdef CONFIG_NLS_ISO8859_8
453
        init_nls_iso8859_8();
454
#endif
455
#ifdef CONFIG_NLS_ISO8859_9
456
        init_nls_iso8859_9();
457
#endif
458
#ifdef CONFIG_NLS_ISO8859_15
459
        init_nls_iso8859_15();
460
#endif
461
#ifdef CONFIG_NLS_CODEPAGE_437
462
        init_nls_cp437();
463
#endif
464
#ifdef CONFIG_NLS_CODEPAGE_737
465
        init_nls_cp737();
466
#endif
467
#ifdef CONFIG_NLS_CODEPAGE_775
468
        init_nls_cp775();
469
#endif
470
#ifdef CONFIG_NLS_CODEPAGE_850
471
        init_nls_cp850();
472
#endif
473
#ifdef CONFIG_NLS_CODEPAGE_852
474
        init_nls_cp852();
475
#endif
476
#ifdef CONFIG_NLS_CODEPAGE_855
477
        init_nls_cp855();
478
#endif
479
#ifdef CONFIG_NLS_CODEPAGE_857
480
        init_nls_cp857();
481
#endif
482
#ifdef CONFIG_NLS_CODEPAGE_860
483
        init_nls_cp860();
484
#endif
485
#ifdef CONFIG_NLS_CODEPAGE_861
486
        init_nls_cp861();
487
#endif
488
#ifdef CONFIG_NLS_CODEPAGE_862
489
        init_nls_cp862();
490
#endif
491
#ifdef CONFIG_NLS_CODEPAGE_863
492
        init_nls_cp863();
493
#endif
494
#ifdef CONFIG_NLS_CODEPAGE_864
495
        init_nls_cp864();
496
#endif
497
#ifdef CONFIG_NLS_CODEPAGE_865
498
        init_nls_cp865();
499
#endif
500
#ifdef CONFIG_NLS_CODEPAGE_866
501
        init_nls_cp866();
502
#endif
503
#ifdef CONFIG_NLS_CODEPAGE_869
504
        init_nls_cp869();
505
#endif
506
#ifdef CONFIG_NLS_CODEPAGE_874
507
        init_nls_cp874();
508
#endif
509
#ifdef CONFIG_NLS_KOI8_R
510
        init_nls_koi8_r();
511
#endif
512
#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
513
        return 0;
514
#else
515
        return register_symtab(&nls_syms);
516
#endif
517
}
518
 
519
#ifdef MODULE
520
int init_module(void)
521
{
522
        return init_nls();
523
}
524
 
525
 
526
void cleanup_module(void)
527
{
528
}
529
#endif /* ifdef MODULE */
530
 
531
#endif /* _LINUX_FS_NLS_C */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.