2 * The UniCode Library -- Debugging Support Functions
4 * (c) 1997 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
11 #include "charset/unicode.h"
14 get_static_buffer(uns size)
16 static byte *static_debug_buffer;
17 static uns static_debug_size;
19 if (!static_debug_buffer)
23 static_debug_buffer = xmalloc(size);
24 static_debug_size = size;
26 else if (static_debug_size < size)
28 size = (size+1023) & ~1023;
29 static_debug_buffer = xrealloc(static_debug_buffer, size);
30 static_debug_size = size;
32 return static_debug_buffer;
36 static_ucs2_to_utf8(word *w)
38 byte *buf = get_static_buffer(Ustrlen(w) * 3 + 1);