diff options
author | javier <javier@pcjavier.(none)> | 2010-11-07 03:00:56 +0100 |
---|---|---|
committer | javier <javier@pcjavier.(none)> | 2010-11-07 03:00:56 +0100 |
commit | 2ab60ecb15ab1a7e30226563a15bbeec05dda54d (patch) | |
tree | c117593d0687b274f66898c9d54b4ea9ffb01e33 /data/make-table.c | |
download | cfmradio-2ab60ecb15ab1a7e30226563a15bbeec05dda54d.tar.gz cfmradio-2ab60ecb15ab1a7e30226563a15bbeec05dda54d.zip |
initial import
Diffstat (limited to 'data/make-table.c')
-rw-r--r-- | data/make-table.c | 32 |
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; +} |