1 --- src/common/classes/array.h.orig 2012-06-20 09:58:37.000000000 +0200
2 +++ src/common/classes/array.h 2012-06-26 10:37:49.000000000 +0200
4 size_t add(const Value& item) {
6 find(KeyOfValue::generate(this, item), pos);
8 + this->insert(pos, item);
12 --- src/common/classes/stack.h.orig 2012-06-20 09:58:37.000000000 +0200
13 +++ src/common/classes/stack.h 2012-06-26 10:41:54.000000000 +0200
15 Entry(Object e, Entry* stk)
16 : inherited(), next(stk)
22 Entry(Entry* stk) : inherited(), next(stk) { }
25 if (inherited::getCount() < this->getCapacity())
31 Entry* newEntry = FB_NEW(p) Entry(e, this);
32 --- src/common/classes/vector.h.orig 2012-06-20 09:58:37.000000000 +0200
33 +++ src/common/classes/vector.h 2012-06-26 10:37:49.000000000 +0200
35 size_t add(const Value& item) {
37 find(KeyOfValue::generate(this, item), pos);
39 + this->insert(pos, item);
43 --- src/jrd/Collation.cpp.orig 2012-06-20 09:58:27.000000000 +0200
44 +++ src/jrd/Collation.cpp 2012-06-26 11:35:42.000000000 +0200
45 @@ -191,154 +191,53 @@
48 template <class SLEUTHTYPE>
49 -bool SLEUTHNAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj, USHORT flags,
50 - const SLEUTHTYPE* search, SLONG search_len,
51 - const SLEUTHTYPE* match, SLONG match_len)
53 -/**************************************
55 - * E V L _ ? ? _ s l e u t h _ c h e c k
57 - **************************************
59 - * Functional description
60 - * Evaluate the "sleuth" search operator.
62 - * Turn the (pointer, byte length) input parameters into
63 - * (pointer, end_pointer) for use in SLEUTH_AUX
65 - **************************************/
66 - fb_assert((match_len % sizeof(SLEUTHTYPE)) == 0);
67 - fb_assert((search_len % sizeof(SLEUTHTYPE)) == 0);
68 - fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE));
70 - const SLEUTHTYPE* const end_match = match + (match_len / sizeof(SLEUTHTYPE));
71 - const SLEUTHTYPE* const end_search = search + (search_len / sizeof(SLEUTHTYPE));
73 - return SLEUTH_AUX(obj, flags, search, end_search, match, end_match);
77 -template <class SLEUTHTYPE>
78 -ULONG SLEUTH_MERGE_NAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj,
79 - const SLEUTHTYPE* match, SLONG match_bytes,
80 - const SLEUTHTYPE* control, SLONG control_bytes,
81 - SLEUTHTYPE* combined, SLONG combined_bytes)
82 +static bool SLEUTH_CLASS_NAME(
85 + const SLEUTHTYPE* char_class,
86 + const SLEUTHTYPE* const end_class,
87 + SLEUTHTYPE character)
89 /**************************************
91 - * E V L _ ? ? _ s l e u t h _ m e r g e
92 + * s l e u t h _ c l a s s
94 **************************************
96 * Functional description
97 - * Merge the matching pattern and control strings to give a cannonical
98 - * matching pattern. Return the length of the combined string.
100 - * What this routine does is to take the language template, strip off
101 - * the prefix and put it in the output string, then parse the definitions
102 - * into an array of character pointers. The index array is the defined
103 - * character. The routine then takes the actual match pattern and uses
104 - * the characters in it to index into the definitions to produce an equivalent
105 - * pattern in the cannonical language.
107 - * The silly loop setting *v++ to zero initializes the array up to the
108 - * highest character defined (also max_op). Believe it or not, that part
110 + * See if a character is a member of a class.
111 + * Japanese version operates on short-based buffer,
112 + * instead of SCHAR-based.
114 **************************************/
115 - fb_assert(match != NULL);
116 - fb_assert(control != NULL);
117 - fb_assert(combined != NULL);
119 - fb_assert((match_bytes % sizeof(SLEUTHTYPE)) == 0);
120 - fb_assert((control_bytes % sizeof(SLEUTHTYPE)) == 0);
121 + fb_assert(char_class != NULL);
122 + fb_assert(end_class != NULL);
123 + fb_assert(char_class <= end_class);
124 fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE));
126 - const SLEUTHTYPE* const end_match = match + (match_bytes / sizeof(SLEUTHTYPE));
127 - const SLEUTHTYPE* const end_control = control + (control_bytes / sizeof(SLEUTHTYPE));
129 - SLEUTHTYPE max_op = 0;
130 - SLEUTHTYPE* comb = combined;
131 - SLEUTHTYPE* vector[256];
132 - SLEUTHTYPE** v = vector;
133 - SLEUTHTYPE temp[256];
134 - SLEUTHTYPE* t = temp;
136 -/* Parse control string into substitution strings and initializing string */
137 + bool result = true;
139 - while (control < end_control) {
140 - SLEUTHTYPE c = *control++;
141 - if (*control == *(SLEUTHTYPE*)obj->getGdmlSubstituteCanonic()) {
142 - /* Note: don't allow substitution characters larger than vector */
143 - SLEUTHTYPE** const end_vector =
144 - vector + (((int)c < FB_NELEM(vector)) ? c : 0);
145 - while (v <= end_vector)
149 - while (control < end_control) {
151 - if ((t > temp && t[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic())
152 - || ((c != *(SLEUTHTYPE*)obj->getGdmlCommaCanonic()) && (c != *(SLEUTHTYPE*)obj->getGdmlRParenCanonic())))
161 - else if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && control < end_control)
162 - *comb++ = *control++;
163 - else if (c == *(SLEUTHTYPE*)obj->getGdmlRParenCanonic())
165 - else if (c != *(SLEUTHTYPE*)obj->getGdmlLParenCanonic())
167 + if (*char_class == *(SLEUTHTYPE*)obj->getGdmlNotCanonic()) {
172 - max_op = v - vector;
174 -/* Interpret matching string, substituting where appropriate */
176 - while (match < end_match) {
177 - const SLEUTHTYPE c = *match++;
179 - /* if we've got a defined character, slurp the definition */
182 - if (c <= max_op && (p = vector[c])) {
186 - /* if we've got the definition of a quote character,
187 - slurp the next character too */
189 - if (comb > combined && comb[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && *match)
190 - *comb++ = *match++;
191 + while (char_class < end_class) {
192 + const SLEUTHTYPE c = *char_class++;
193 + if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) {
194 + if (*char_class++ == character)
198 - /* at this point we've got a non-match, but as it might be one of ours,
202 - if ((((size_t) c) < FB_NELEM(special)) && special[c] &&
203 - comb > combined && comb[-1] != *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic())
205 - *comb++ = *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic();
208 + else if (*char_class == *(SLEUTHTYPE*)obj->getGdmlRangeCanonic()) {
210 + if (character >= c && character <= char_class[-1])
213 + else if (character == c)
217 -/* Put in trailing stuff */
219 - while (control < end_control)
220 - *comb++ = *control++;
222 - /* YYY - need to add code watching for overflow of combined */
224 - return (comb - combined) * sizeof(SLEUTHTYPE);
229 @@ -473,53 +372,154 @@
232 template <class SLEUTHTYPE>
233 -static bool SLEUTH_CLASS_NAME(
234 - Jrd::TextType* obj,
236 - const SLEUTHTYPE* char_class,
237 - const SLEUTHTYPE* const end_class,
238 - SLEUTHTYPE character)
239 +bool SLEUTHNAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj, USHORT flags,
240 + const SLEUTHTYPE* search, SLONG search_len,
241 + const SLEUTHTYPE* match, SLONG match_len)
243 /**************************************
245 - * s l e u t h _ c l a s s
246 + * E V L _ ? ? _ s l e u t h _ c h e c k
248 **************************************
250 * Functional description
251 - * See if a character is a member of a class.
252 - * Japanese version operates on short-based buffer,
253 - * instead of SCHAR-based.
254 + * Evaluate the "sleuth" search operator.
256 + * Turn the (pointer, byte length) input parameters into
257 + * (pointer, end_pointer) for use in SLEUTH_AUX
259 **************************************/
260 - fb_assert(char_class != NULL);
261 - fb_assert(end_class != NULL);
262 - fb_assert(char_class <= end_class);
263 + fb_assert((match_len % sizeof(SLEUTHTYPE)) == 0);
264 + fb_assert((search_len % sizeof(SLEUTHTYPE)) == 0);
265 fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE));
267 - bool result = true;
268 + const SLEUTHTYPE* const end_match = match + (match_len / sizeof(SLEUTHTYPE));
269 + const SLEUTHTYPE* const end_search = search + (search_len / sizeof(SLEUTHTYPE));
271 - if (*char_class == *(SLEUTHTYPE*)obj->getGdmlNotCanonic()) {
274 + return SLEUTH_AUX(obj, flags, search, end_search, match, end_match);
278 +template <class SLEUTHTYPE>
279 +ULONG SLEUTH_MERGE_NAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj,
280 + const SLEUTHTYPE* match, SLONG match_bytes,
281 + const SLEUTHTYPE* control, SLONG control_bytes,
282 + SLEUTHTYPE* combined, SLONG combined_bytes)
284 +/**************************************
286 + * E V L _ ? ? _ s l e u t h _ m e r g e
288 + **************************************
290 + * Functional description
291 + * Merge the matching pattern and control strings to give a cannonical
292 + * matching pattern. Return the length of the combined string.
294 + * What this routine does is to take the language template, strip off
295 + * the prefix and put it in the output string, then parse the definitions
296 + * into an array of character pointers. The index array is the defined
297 + * character. The routine then takes the actual match pattern and uses
298 + * the characters in it to index into the definitions to produce an equivalent
299 + * pattern in the cannonical language.
301 + * The silly loop setting *v++ to zero initializes the array up to the
302 + * highest character defined (also max_op). Believe it or not, that part
305 + **************************************/
306 + fb_assert(match != NULL);
307 + fb_assert(control != NULL);
308 + fb_assert(combined != NULL);
310 + fb_assert((match_bytes % sizeof(SLEUTHTYPE)) == 0);
311 + fb_assert((control_bytes % sizeof(SLEUTHTYPE)) == 0);
312 + fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE));
314 + const SLEUTHTYPE* const end_match = match + (match_bytes / sizeof(SLEUTHTYPE));
315 + const SLEUTHTYPE* const end_control = control + (control_bytes / sizeof(SLEUTHTYPE));
317 + SLEUTHTYPE max_op = 0;
318 + SLEUTHTYPE* comb = combined;
319 + SLEUTHTYPE* vector[256];
320 + SLEUTHTYPE** v = vector;
321 + SLEUTHTYPE temp[256];
322 + SLEUTHTYPE* t = temp;
324 +/* Parse control string into substitution strings and initializing string */
326 + while (control < end_control) {
327 + SLEUTHTYPE c = *control++;
328 + if (*control == *(SLEUTHTYPE*)obj->getGdmlSubstituteCanonic()) {
329 + /* Note: don't allow substitution characters larger than vector */
330 + SLEUTHTYPE** const end_vector =
331 + vector + (((int)c < FB_NELEM(vector)) ? c : 0);
332 + while (v <= end_vector)
336 + while (control < end_control) {
338 + if ((t > temp && t[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic())
339 + || ((c != *(SLEUTHTYPE*)obj->getGdmlCommaCanonic()) && (c != *(SLEUTHTYPE*)obj->getGdmlRParenCanonic())))
348 + else if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && control < end_control)
349 + *comb++ = *control++;
350 + else if (c == *(SLEUTHTYPE*)obj->getGdmlRParenCanonic())
352 + else if (c != *(SLEUTHTYPE*)obj->getGdmlLParenCanonic())
356 - while (char_class < end_class) {
357 - const SLEUTHTYPE c = *char_class++;
358 - if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) {
359 - if (*char_class++ == character)
361 + max_op = v - vector;
363 +/* Interpret matching string, substituting where appropriate */
365 + while (match < end_match) {
366 + const SLEUTHTYPE c = *match++;
368 + /* if we've got a defined character, slurp the definition */
371 + if (c <= max_op && (p = vector[c])) {
375 + /* if we've got the definition of a quote character,
376 + slurp the next character too */
378 + if (comb > combined && comb[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && *match)
379 + *comb++ = *match++;
381 - else if (*char_class == *(SLEUTHTYPE*)obj->getGdmlRangeCanonic()) {
383 - if (character >= c && character <= char_class[-1])
386 + /* at this point we've got a non-match, but as it might be one of ours,
390 + if ((((size_t) c) < FB_NELEM(special)) && special[c] &&
391 + comb > combined && comb[-1] != *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic())
393 + *comb++ = *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic();
397 - else if (character == c)
402 +/* Put in trailing stuff */
404 + while (control < end_control)
405 + *comb++ = *control++;
407 + /* YYY - need to add code watching for overflow of combined */
409 + return (comb - combined) * sizeof(SLEUTHTYPE);