From 36bc6cd0952b2eddc17e7da803d85decf96d32cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sun, 28 Sep 2014 03:51:45 +0200
Subject: 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
---
demo-glib.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
(limited to 'demo-glib.c')
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
#include
+#include
+#include
#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);
}
--
cgit v1.2.3