1 /*
2 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Paul Borman at Krystal Technologies.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
93
94 typedef int __rune_t; /* rune_t (see above) */
95
96 /*
97 * The lower 8 bits of runetype[] contain the digit value of the rune.
98 */
99 typedef struct {
100 __rune_t __min; /* First rune of the range */
101 __rune_t __max; /* Last rune (inclusive) of the range */
102 __rune_t __map; /* What first maps to in maps */
103 unsigned *__types; /* Array of types in range */
104 } _RuneEntry;
105
106 typedef struct {
107 int __nranges; /* Number of ranges stored */
108 _RuneEntry *__ranges; /* Pointer to the ranges */
109 } _RuneRange;
110
111 typedef struct {
112 char __magic[8]; /* Magic saying what version we are */
113 char __encoding[32]; /* ASCII name of this encoding */
114
115 unsigned int __runetype[_CACHED_RUNES];
116 __rune_t __maplower[_CACHED_RUNES];
117 __rune_t __mapupper[_CACHED_RUNES];
118
119 /*
120 * The following are to deal with Runes larger than _CACHED_RUNES - 1.
121 * Their data is actually contiguous with this structure so as to make
122 * it easier to read/write from/to disk.
123 */
124 _RuneRange __runetype_ext;
125 _RuneRange __maplower_ext;
126 _RuneRange __mapupper_ext;
127
128 void *__variable; /* Data which depends on the encoding */
129 int __variable_len; /* how long that data is */
130 } _RuneLocale;
131
132 #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */
133
134 extern _RuneLocale _DefaultRuneLocale;
135 extern _RuneLocale *_CurrentRuneLocale;
136
137 #endif /* !_RUNETYPE_H_ */
|
1 /*
2 * Copyright 2013 Garrett D'Amore <garrett@damore.org>
3 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Paul Borman at Krystal Technologies.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
94
95 typedef int __rune_t; /* rune_t (see above) */
96
97 /*
98 * The lower 8 bits of runetype[] contain the digit value of the rune.
99 */
100 typedef struct {
101 __rune_t __min; /* First rune of the range */
102 __rune_t __max; /* Last rune (inclusive) of the range */
103 __rune_t __map; /* What first maps to in maps */
104 unsigned *__types; /* Array of types in range */
105 } _RuneEntry;
106
107 typedef struct {
108 int __nranges; /* Number of ranges stored */
109 _RuneEntry *__ranges; /* Pointer to the ranges */
110 } _RuneRange;
111
112 typedef struct {
113 char __magic[8]; /* Magic saying what version we are */
114 char __encoding[32]; /* ASCII name of encoding */
115
116 unsigned int __runetype[_CACHED_RUNES];
117 __rune_t __maplower[_CACHED_RUNES];
118 __rune_t __mapupper[_CACHED_RUNES];
119
120 /*
121 * The following are to deal with Runes larger than _CACHED_RUNES - 1.
122 * Their data is actually contiguous with this structure so as to make
123 * it easier to read/write from/to disk.
124 */
125 _RuneRange __runetype_ext;
126 _RuneRange __maplower_ext;
127 _RuneRange __mapupper_ext;
128
129 void *__variable; /* Data which depends on the encoding */
130 int __variable_len; /* how long that data is */
131 } _RuneLocale;
132
133 #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */
134
135 extern _RuneLocale _DefaultRuneLocale;
136
137 unsigned int __runetype(const _RuneLocale *, int);
138
139 #endif /* !_RUNETYPE_H_ */
|