summaryrefslogtreecommitdiffstats
path: root/src/libsigrok-test.c
blob: cfb23c687038d4a71402eee01e1e63bf1b2ff555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * This file is part of MXE. See LICENSE.md for licensing information.
 */

#include <stdio.h>
#include <libsigrok/libsigrok.h>

int main(int argc, char **argv)
{
    int ret;
    struct sr_context *sr_ctx;
    (void)argc;
    (void)argv;

    if ((ret = sr_init(&sr_ctx)) != SR_OK) {
          printf("Error initializing libsigrok (%s): %s.\n",
                 sr_strerror_name(ret), sr_strerror(ret));
          return 1;
    }
    if ((ret = sr_exit(sr_ctx)) != SR_OK) {
          printf("Error shutting down libsigrok (%s): %s.\n",
                 sr_strerror_name(ret), sr_strerror(ret));
          return 1;
    }
    return 0;
}