#include "console.h"
#include "log.h"
+#include "unicode.h"
/* print buffer with boundary */
static void print_buf(struct kmscon_buffer *buf)
kmscon_char_free(ch);
}
+static void test2()
+{
+ struct kmscon_symbol_table *st;
+ int ret;
+ kmscon_symbol_t sym, sym2, sym3, sym4;
+ const uint32_t *str;
+ size_t len, i;
+
+ log_info("Test2:\n");
+
+ ret = kmscon_symbol_table_new(&st);
+ if (ret)
+ return;
+
+ sym = kmscon_symbol_make('a');
+ sym2 = kmscon_symbol_append(st, sym, '^');
+ sym3 = kmscon_symbol_append(st, sym2, '^');
+ sym4 = kmscon_symbol_append(st, sym, '^');
+
+ log_info("equality: %i %i %i\n", sym == sym2, sym2 == sym4,
+ sym3 == sym2);
+
+ str = kmscon_symbol_get(st, &sym3, &len);
+
+ printf("sym3: ");
+ for (i = 0; i < len; ++i)
+ printf("%c", str[i]);
+ printf("\n");
+
+ kmscon_symbol_table_unref(st);
+}
+
int main(int argc, char **argv)
{
struct kmscon_buffer *buf;
}
test1(buf);
+ test2();
kmscon_buffer_unref(buf);
err_out: