summaryrefslogtreecommitdiff
path: root/data/make-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'data/make-table.c')
-rw-r--r--data/make-table.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/data/make-table.c b/data/make-table.c
new file mode 100644
index 0000000..9afca7d
--- /dev/null
+++ b/data/make-table.c
@@ -0,0 +1,32 @@
+#include <glib.h>
+
+int main(int argc, char **argv) {
+ GError *error = NULL;
+ gchar *data;
+ if (!g_file_get_contents("codetables.utf8", &data, NULL, &error)) {
+ g_printerr("Failed to open %s: %s\n", error->message);
+ return 1;
+ }
+
+ gint i;
+ guint count = 0;
+
+ for (i = 0; i < 0x20; i++) {
+ g_print("\t%u,\t/* %u */\n", 0, count);
+ count++;
+ }
+
+ gchar * c = data;
+ while (*c) {
+ if (*c != '\n') {
+ gunichar u = g_utf8_get_char(c);
+ g_print("\t%u,\t/* %u */\n", u, count);
+ count++;
+ }
+ c = g_utf8_next_char(c);
+ }
+
+ g_printerr("Total elements = %d\n", count);
+
+ return 0;
+}