X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=main.cpp;h=a7ab89fbf7422ada41d7050ac57715ce33f7f05d;hp=f4506787364fa11ea01286cf2e569ffed5587c15;hb=31e6731d976cb2b398c92763a9d3507437b8a826;hpb=333d5bbc0a326e6fa82db44f3e6ba8dd79cafdd8 diff --git a/main.cpp b/main.cpp index f4506787..a7ab89fb 100644 --- a/main.cpp +++ b/main.cpp @@ -20,6 +20,7 @@ extern "C" { #include /* First, so we avoid a _POSIX_C_SOURCE warning. */ +#include #include #include } @@ -45,11 +46,26 @@ void usage() "\n", PV_BIN_NAME, PV_DESCRIPTION); } +/* + * SIGINT handler (likely recieved Ctrl-C from terminal) + */ +void sigint(int param) +{ + (void) param; + + qDebug("pv: Recieved SIGINT"); + + /* TODO: Handle SIGINT */ +} + int main(int argc, char *argv[]) { int ret = 0; struct sr_context *sr_ctx = NULL; + // Register a SIGINT handler + signal (SIGINT, sigint); + QApplication a(argc, argv); // Set some application metadata