aboutsummaryrefslogtreecommitdiff
path: root/demo-glib.c
diff options
context:
space:
mode:
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);
}