]> sigrok.org Git - sigrok-cli.git/blobdiff - anykey.c
cli: factor out output format setup
[sigrok-cli.git] / anykey.c
index f0ab52efe6548a9654822781670acd4ab80d046d..478e644c31edb156678bc36a6c73f76081442581 100644 (file)
--- a/anykey.c
+++ b/anykey.c
@@ -36,12 +36,12 @@ static DWORD stdin_mode;
 static struct termios term_orig;
 #endif
 
 static struct termios term_orig;
 #endif
 
-static int received_anykey(int fd, int revents, void *user_data)
+static int received_anykey(int fd, int revents, void *cb_data)
 {
        /* Avoid compiler warnings. */
        (void)fd;
        (void)revents;
 {
        /* Avoid compiler warnings. */
        (void)fd;
        (void)revents;
-       (void)user_data;
+       (void)cb_data;
 
        sr_session_stop();
 
 
        sr_session_stop();
 
@@ -70,7 +70,7 @@ void add_anykey(void)
 
        sr_session_source_add(STDIN_FILENO, G_IO_IN, -1, received_anykey, NULL);
 
 
        sr_session_source_add(STDIN_FILENO, G_IO_IN, -1, received_anykey, NULL);
 
-       printf("Press any key to stop acquisition.\n");
+       g_message("Press any key to stop acquisition.");
 }
 
 /* Restore stdin attributes. */
 }
 
 /* Restore stdin attributes. */