]>
Commit | Line | Data |
---|---|---|
d23ca7f3 AS |
1 | /* |
2 | * Copyright (C) 2021 Andreas Steffen | |
3 | * | |
19ef2aec TB |
4 | * Copyright (C) secunet Security Networks AG |
5 | * | |
d23ca7f3 AS |
6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
15 | */ | |
16 | ||
17 | #include <stdio.h> | |
18 | ||
19 | #include <library.h> | |
20 | #include <utils/debug.h> | |
21 | #include <imc/imc_os_info.h> | |
22 | ||
23 | /** | |
24 | * Define debug level | |
25 | */ | |
26 | static level_t dbg_level = 1; | |
27 | ||
28 | static void dbg_os_info(debug_t group, level_t level, char *fmt, ...) | |
29 | { | |
30 | if ((level <= dbg_level) || level <= 1) | |
31 | { | |
32 | va_list args; | |
33 | ||
34 | va_start(args, fmt); | |
35 | vfprintf(stderr, fmt, args); | |
36 | fprintf(stderr, "\n"); | |
37 | va_end(args); | |
38 | } | |
39 | } | |
40 | ||
41 | int main(int argc, char *argv[]) | |
42 | { | |
43 | imc_os_info_t *os_info; | |
44 | bool all; | |
45 | ||
46 | all = argc > 1; | |
47 | ||
48 | library_init(NULL, "os_info"); | |
49 | atexit(library_deinit); | |
50 | ||
51 | dbg = dbg_os_info; | |
52 | ||
53 | os_info = imc_os_info_create(all); | |
54 | os_info->destroy(os_info); | |
55 | ||
56 | return 0; | |
57 | } |