summaryrefslogtreecommitdiff
path: root/src/apk_applet.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-10-05 18:52:51 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-10-09 16:09:19 +0300
commit354713d2f746c197eed6a1feb4c6af3420af6c15 (patch)
treef9dd51bbdde0f25f8e122832cf006076b8452d28 /src/apk_applet.h
parent7a7eca86709fcf31dbb1acf8b82ff411828fb67b (diff)
downloadapk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.tar.gz
apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.tar.bz2
apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.tar.xz
apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.zip
rename apk_db_options to apk_ctx, rework logging
makes apk_verbosity non-global fixes #10682
Diffstat (limited to 'src/apk_applet.h')
-rw-r--r--src/apk_applet.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/apk_applet.h b/src/apk_applet.h
index 8e59390..2f4518b 100644
--- a/src/apk_applet.h
+++ b/src/apk_applet.h
@@ -15,13 +15,6 @@
#include "apk_defines.h"
#include "apk_database.h"
-#if 0
-#define APK_OPT1n(_opt) "\xf0" _opt "\x00"
-#define APK_OPT1R(_opt) "\xaf" "\xf0" _opt "\x00"
-#define APK_OPT2n(_opt, _short) _short _opt "\x00"
-#define APK_OPT2R(_opt, _short) "\xaf" _short _opt "\x00"
-#endif
-
#define __APK_OPTAPPLET "\x00"
#define __APK_OPTGROUP(_name) _name "\x00"
#define __APK_OPT_ENUM(_enum,__desc) _enum,
@@ -45,8 +38,7 @@
struct apk_option_group {
const char *desc;
- int (*parse)(void *ctx, struct apk_db_options *dbopts,
- int opt, const char *optarg);
+ int (*parse)(void *ctx, struct apk_ctx *ac, int opt, const char *optarg);
};
struct apk_applet {
@@ -63,10 +55,13 @@ struct apk_applet {
extern const struct apk_option_group optgroup_global, optgroup_commit, optgroup_signing;
-void apk_help(struct apk_applet *applet);
void apk_applet_register(struct apk_applet *);
+void apk_applet_register_builtin(void);
+struct apk_applet *apk_applet_find(const char *name);
+void apk_applet_help(struct apk_applet *applet, struct apk_out *out);
typedef void (*apk_init_func_t)(void);
+
#define APK_DEFINE_APPLET(x) \
static void __register_##x(void) { apk_applet_register(&x); } \
static apk_init_func_t __regfunc_##x __attribute__((__section__("initapplets"))) __attribute((used)) = __register_##x;