summaryrefslogtreecommitdiff
path: root/data/make-table.c
diff options
context:
space:
mode:
authorjavier <javier@pcjavier.(none)>2010-11-07 03:00:56 +0100
committerjavier <javier@pcjavier.(none)>2010-11-07 03:00:56 +0100
commit2ab60ecb15ab1a7e30226563a15bbeec05dda54d (patch)
treec117593d0687b274f66898c9d54b4ea9ffb01e33 /data/make-table.c
downloadcfmradio-2ab60ecb15ab1a7e30226563a15bbeec05dda54d.tar.gz
cfmradio-2ab60ecb15ab1a7e30226563a15bbeec05dda54d.zip
initial import
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;
+}