2 * The UniCode Library -- Debugging Support Functions
4 * (c) 1997 Martin Mares <mj@ucw.cz>
8 #include "charset/unicode.h"
11 get_static_buffer(uns size)
13 static byte *static_debug_buffer;
14 static uns static_debug_size;
16 if (!static_debug_buffer)
20 static_debug_buffer = xmalloc(size);
21 static_debug_size = size;
23 else if (static_debug_size < size)
25 size = (size+1023) & ~1023;
26 static_debug_buffer = xrealloc(static_debug_buffer, size);
27 static_debug_size = size;
29 return static_debug_buffer;
33 static_ucs2_to_utf8(word *w)
35 byte *buf = get_static_buffer(Ustrlen(w) * 3 + 1);