cemu
载入中...
搜索中...
未找到
utils.h
浏览该文件的文档.
1
12#ifndef UTILS_H
13#define UTILS_H
14
15
16// ==================================================================== //
17// Include
18// ==================================================================== //
19
20#include "log.h"
21// #include "argparse-new.h"
22#include "argparse.h"
23#include "linenoise.h"
24#include "unittest.h"
25#include "typedef.h"
26#include "macro.h"
27// #include "list.h"
28// #include "obj.h"
29
30
31// ==================================================================== //
32// Data: Args def
33// ==================================================================== //
34
35// Step1: 定义参数
36ap_def_args(default_args) = {
37 {.short_arg = "o", .long_arg = "output", .init.s = "./a.out", .help = "set output path"},
38 {.short_arg = "q", .long_arg = "quiet", .init.i = 3, .help = "set quiet level"},
39 AP_INPUT_ARG,
40 AP_END_ARG};
41
42ap_def_args(test_args) = {
43 {.short_arg = "o", .long_arg = "output", .init.s = "./test", .help = "set output path"},
44 {.short_arg = "q", .long_arg = "quiet", .init.i = 3, .help = "set quiet level"},
45 AP_END_ARG};
46
47ap_def_args(debug_args) = {
48 {.short_arg = "o", .long_arg = "output", .init.s = "./test", .help = "set output path"},
49 {.short_arg = "l", .long_arg = "log", .init.s = "./log", .help = "set log file"},
50 AP_INPUT_ARG,
51 AP_END_ARG};
52
53
54
55// ==================================================================== //
56// Declare API: Utils
57// ==================================================================== //
58
59void run_unit_test();
60
61// Step2: 定义回调函数
62ap_def_callback(default_callback);
63ap_def_callback(hello_callback);
64ap_def_callback(debug_callback);
65ap_def_callback(test_callback);
66
73void arg_parser(int argc, char *argv[], char *envp[]);
74
75
76#endif
命令行解析库头文件
REPL工具库头文件
日志库头文件
单元测试头文件
void arg_parser(int argc, char *argv[], char *envp[])
参数解析
Definition utils.c:22