/*
- * This file is part of the sigrok project.
+ * This file is part of the sigrok-cli project.
*
* Copyright (C) 2011 Bert Vermeulen <bert@biot.com>
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "sigrok-cli.h"
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
-#include <sigrok.h>
-#include "sigrok-cli.h"
#ifdef _WIN32
static HANDLE stdin_handle;
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;
- (void)user_data;
+ (void)cb_data;
+ sr_session_source_remove(STDIN_FILENO);
sr_session_stop();
return TRUE;
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. */