Rizin
unix-like reverse engineering framework and cli tools
rz_main.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2008-2020 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef RZ_MAIN_H
5 #define RZ_MAIN_H
6 
7 #include <rz_types.h>
8 #include <rz_getopt.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
15 
16 typedef struct rz_main_t {
17  const char *name;
18  int (*main)(int argc, const char **argv);
19  // stdin/stdout
21 
22 #if __WINDOWS__
23 #define MAIN_NAME wmain
24 #define ARGV_TYPE wchar_t
25 #define ARGV_TYPE_TO_UTF8(argc, argv) rz_sys_utf8_argv_new(argc, argv)
26 #define FREE_UTF8_ARGV(argc, utf8_argv) rz_sys_utf8_argv_free(argc, utf8_argv)
27 #else
28 #define MAIN_NAME main
29 #define ARGV_TYPE char
30 #define ARGV_TYPE_TO_UTF8(argc, argv) (char **)argv
31 #define FREE_UTF8_ARGV(argc, utf8_argv)
32 #endif
33 
34 typedef int (*RzMainCallback)(int argc, const char **argv);
35 
36 RZ_API RzMain *rz_main_new(const char *name);
38 RZ_API int rz_main_run(RzMain *m, int argc, const char **argv);
39 
40 RZ_API int rz_main_version_print(const char *program);
41 RZ_API int rz_main_rz_ax(int argc, const char **argv);
42 RZ_API int rz_main_rz_run(int argc, const char **argv);
43 RZ_API int rz_main_rz_hash(int argc, const char **argv);
44 RZ_API int rz_main_rz_bin(int argc, const char **argv);
45 RZ_API int rz_main_rizin(int argc, const char **argv);
46 RZ_API int rz_main_rz_asm(int argc, const char **argv);
47 RZ_API int rz_main_rz_agent(int argc, const char **argv);
48 RZ_API int rz_main_rz_find(int argc, const char **argv);
49 RZ_API int rz_main_rz_diff(int argc, const char **argv);
50 RZ_API int rz_main_rz_gg(int argc, const char **argv);
51 RZ_API int rz_main_rz_sign(int argc, const char **argv);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif
#define RZ_API
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
RZ_API int rz_main_version_print(const char *program)
Definition: main.c:49
RZ_API int rz_main_rizin(int argc, const char **argv)
Definition: rizin.c:370
struct rz_main_t RzMain
RZ_API int rz_main_rz_find(int argc, const char **argv)
Definition: rz-find.c:474
RZ_API int rz_main_rz_diff(int argc, const char **argv)
Definition: rz-diff.c:2254
RZ_API int rz_main_rz_ax(int argc, const char **argv)
Definition: rz-ax.c:721
RZ_API void rz_main_free(RzMain *m)
Definition: main.c:40
RZ_LIB_VERSION_HEADER(rz_main)
RZ_API int rz_main_rz_hash(int argc, const char **argv)
Definition: rz-hash.c:1205
RZ_API int rz_main_run(RzMain *m, int argc, const char **argv)
Definition: main.c:44
RZ_API int rz_main_rz_sign(int argc, const char **argv)
Definition: rz-sign.c:40
RZ_API int rz_main_rz_asm(int argc, const char **argv)
RZ_API int rz_main_rz_run(int argc, const char **argv)
Definition: rz-run.c:25
RZ_API int rz_main_rz_agent(int argc, const char **argv)
Definition: rz-agent.c:61
RZ_API RzMain * rz_main_new(const char *name)
Definition: main.c:24
RZ_API int rz_main_rz_gg(int argc, const char **argv)
Definition: rz-gg.c:116
RZ_API int rz_main_rz_bin(int argc, const char **argv)
Definition: rz-bin.c:681
int(* RzMainCallback)(int argc, const char **argv)
Definition: rz_main.h:34
static int
Definition: sfsocketcall.h:114
Definition: z80asm.h:102
const char * name
Definition: rz_main.h:17
int(* main)(int argc, const char **argv)
Definition: rz_main.h:18