#ifndef _UNLS_H
#define _UNLS_H

typedef unsigned char __u8;
typedef unsigned short __u16;
#ifndef NULL
#define NULL (void*)0
#endif
#ifndef THIS_MODULE
#define THIS_MODULE NULL
#endif
#include <errno.h>

#include "prototyp.h"

#ifdef __cplusplus
extern "C" {
#endif

/* unicode character */
typedef __u16 wchar_t;

struct nls_table {
	char *charset;
	int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen);
	int (*char2uni) (const unsigned char *rawstring, int boundlen,
			 wchar_t *uni);
	unsigned char *charset2lower;
	unsigned char *charset2upper;
	struct module *owner;
	struct nls_table *next;
};

/* this value hold the maximum octet of charset */
#define NLS_MAX_CHARSET_SIZE 3

extern int register_nls __PR((struct nls_table *));
extern int unregister_nls __PR((struct nls_table *));
extern struct nls_table *load_nls __PR((char *));
extern void unload_nls __PR((struct nls_table *));
extern struct nls_table *load_nls_default __PR((void));

extern int utf8_mbtowc __PR((wchar_t *, const __u8 *, int));
extern int utf8_mbstowcs __PR((wchar_t *, const __u8 *, int));
extern int utf8_wctomb __PR((__u8 *, wchar_t, int));
extern int utf8_wcstombs __PR((__u8 *, const wchar_t *, int));

#ifdef __cplusplus
}
#endif

#endif


syntax highlighted by Code2HTML, v. 0.9.1