aboutsummaryrefslogtreecommitdiff
path: root/demo-glib.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-28 03:51:45 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-28 03:59:12 +0200
commit36bc6cd0952b2eddc17e7da803d85decf96d32cc (patch)
tree23488c213f53db83346d3eaf71cb78d74c42eff0 /demo-glib.c
parentcac1f8373bb16aae02ffa80acf8640385bf94591 (diff)
downloadtermo-36bc6cd0952b2eddc17e7da803d85decf96d32cc.tar.gz
termo-36bc6cd0952b2eddc17e7da803d85decf96d32cc.tar.xz
termo-36bc6cd0952b2eddc17e7da803d85decf96d32cc.zip
Move to iconv
That is the major change in this commit. Also Ctrl-modified keys now should work in URxvt, which was surprisingly trivial to achieve. Coming up next: - making sure the tests still work - introducing CMake
Diffstat (limited to 'demo-glib.c')
-rw-r--r--demo-glib.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/demo-glib.c b/demo-glib.c
index 00f5aa2..0162042 100644
--- a/demo-glib.c
+++ b/demo-glib.c
@@ -1,5 +1,7 @@
#include <stdio.h>
#include <glib.h>
+#include <unistd.h>
+#include <locale.h>
#include "termkey.h"
@@ -49,9 +51,13 @@ stdin_io (GIOChannel *source, GIOCondition condition, gpointer data)
int
main (int argc, char *argv[])
{
+ (void) argc;
+ (void) argv;
+
TERMKEY_CHECK_VERSION;
+ setlocale (LC_CTYPE, "");
- tk = termkey_new (0, 0);
+ tk = termkey_new (STDIN_FILENO, NULL, 0);
if (!tk)
{
fprintf (stderr, "Cannot allocate termkey instance\n");
@@ -59,7 +65,8 @@ main (int argc, char *argv[])
}
GMainLoop *loop = g_main_loop_new (NULL, FALSE);
- g_io_add_watch (g_io_channel_unix_new (0), G_IO_IN, stdin_io, NULL);
+ g_io_add_watch (g_io_channel_unix_new (STDIN_FILENO),
+ G_IO_IN, stdin_io, NULL);
g_main_loop_run (loop);
termkey_destroy (tk);
}