ReactOS  0.4.13-dev-551-gf37fb1f
module.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GNU GENERAL PUBLIC LICENSE VERSION 2
3  * PROJECT: ReiserFs file system driver for Windows NT/2000/XP/Vista.
4  * FILE: module.h
5  * PURPOSE: Header file: nls structures & linux kernel ...
6  * PROGRAMMER: Mark Piper, Matt Wu, Bo BrantÚn.
7  * HOMEPAGE:
8  * UPDATE HISTORY:
9  */
10 
11 #ifndef _RFSD_MODULE_HEADER_
12 #define _RFSD_MODULE_HEADER_
13 
14 /* INCLUDES *************************************************************/
15 
16 #include "ntifs.h"
17 #include "linux/types.h"
18 
19 /* STRUCTS & S******************************************************/
20 
21 //
22 // Linux modules
23 //
24 
25 #define __init
26 #define __exit
27 
28 #define try_inc_mod_count(x) TRUE
29 #define __MOD_DEC_USE_COUNT(x) do {} while(FALSE);
30 #define EXPORT_SYMBOL(x)
31 #define THIS_MODULE NULL
32 
33 #define module_init(X) int __init module_##X() {return X();}
34 #define module_exit(X) void __exit module_##X() {X();}
35 
36 #define MODULE_LICENSE(x)
37 
38 #define inline __inline
39 
40 #define DECLARE_INIT(X) extern int __init module_##X(void)
41 #define DECLARE_EXIT(X) extern void __exit module_##X(void)
42 
43 #define LOAD_NLS(X) do { rc = module_##X(); \
44  if (rc != 0) { \
45  goto errorout; \
46  } \
47  } while(0)
48 
49 
50 #define UNLOAD_NLS(X) do { module_##X(); } while(0)
51 
52 //
53 // Spin locks .....
54 //
55 
56 typedef struct _spinlock_t {
57 
60 } spinlock_t;
61 
62 #define spin_lock_init(lock) KeInitializeSpinLock(&((lock)->SpinLock))
63 #define spin_lock(lock) KeAcquireSpinLock(&((lock)->SpinLock), &((lock)->Irql))
64 #define spin_unlock(lock) KeReleaseSpinLock(&((lock)->SpinLock), (lock)->Irql)
65 
66 
67 //
68 // unicode character
69 //
70 
71 struct nls_table {
72  char *charset;
73  int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen);
74  int (*char2uni) (const unsigned char *rawstring, int boundlen,
75  wchar_t *uni);
76  unsigned char *charset2lower;
77  unsigned char *charset2upper;
78  struct module *owner;
79  struct nls_table *next;
80 };
81 
82 /* this value hold the maximum octet of charset */
83 #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */
84 
85 /* nls.c */
86 extern int register_nls(struct nls_table *);
87 extern int unregister_nls(struct nls_table *);
88 extern struct nls_table *load_nls(char *);
89 extern void unload_nls(struct nls_table *);
90 extern struct nls_table *load_nls_default(void);
91 
92 extern int utf8_mbtowc(wchar_t *, const __u8 *, int);
93 extern int utf8_mbstowcs(wchar_t *, const __u8 *, int);
94 extern int utf8_wctomb(__u8 *, wchar_t, int);
95 extern int utf8_wcstombs(__u8 *, const wchar_t *, int);
96 
97 /* FUNCTIONS DECLARATION *****************************************************/
98 
99 #endif // _RFSD_MODULE_HEADER_
struct module * owner
Definition: module.h:1039
int unregister_nls(struct nls_table *)
Definition: nls_base.c:185
unsigned char __u8
Definition: compat.h:88
KIRQL Irql
Definition: module.h:59
struct nls_table * next
Definition: module.h:1040
unsigned char * charset2lower
Definition: module.h:1037
char * charset
Definition: module.h:1032
struct _spinlock_t spinlock_t
void unload_nls(struct nls_table *)
Definition: nls_base.c:240
UCHAR KIRQL
Definition: env_spec_w32.h:591
struct nls_table * load_nls_default(void)
int(* uni2char)(wchar_t uni, unsigned char *out, int boundlen)
Definition: module.h:1034
int utf8_wcstombs(__u8 *, const wchar_t *, int)
Definition: nls_base.c:136
static FILE * out
Definition: regtests2xml.c:44
int register_nls(struct nls_table *)
Definition: nls_base.c:162
int utf8_mbtowc(wchar_t *, const __u8 *, int)
Definition: nls_base.c:49
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
KSPIN_LOCK SpinLock
Definition: module.h:58
unsigned char * charset2upper
Definition: module.h:1038
int(* char2uni)(const unsigned char *rawstring, int boundlen, wchar_t *uni)
Definition: module.h:1035
struct nls_table * load_nls(char *)
Definition: nls_base.c:218
int utf8_mbstowcs(wchar_t *, const __u8 *, int)
Definition: nls_base.c:79
int utf8_wctomb(__u8 *, wchar_t, int)
Definition: nls_base.c:108
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31