summaryrefslogtreecommitdiff
path: root/src/applet.c
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2021-12-10 14:33:52 -0600
committerAriadne Conill <ariadne@dereferenced.org>2021-12-14 12:05:59 -0600
commit3fd120db5c0f6e32740796a914945166d3d887fb (patch)
treec33be69d157a735e51d6de04cd4ed10dc5dae41d /src/applet.c
parent980e58efc6828fb0fe2c83c64d6b76dc95b33813 (diff)
downloadapk-tools-3fd120db5c0f6e32740796a914945166d3d887fb.tar.gz
apk-tools-3fd120db5c0f6e32740796a914945166d3d887fb.tar.bz2
apk-tools-3fd120db5c0f6e32740796a914945166d3d887fb.tar.xz
apk-tools-3fd120db5c0f6e32740796a914945166d3d887fb.zip
applet: rework APK_DEFINE_APPLET to use constructor attribute
this allows the applet registration to work in a portable way, without having to weird things with the linker. ref #10794
Diffstat (limited to 'src/applet.c')
-rw-r--r--src/applet.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/applet.c b/src/applet.c
index 1d47662..5585157 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -10,7 +10,7 @@
#include "apk_applet.h"
#include "apk_print.h"
-static struct list_head apk_applet_list;
+static LIST_HEAD(apk_applet_list);
#define apk_applet_foreach(iter) list_for_each_entry(iter, &apk_applet_list, node)
@@ -20,16 +20,6 @@ void apk_applet_register(struct apk_applet *applet)
list_add_tail(&applet->node, &apk_applet_list);
}
-void apk_applet_register_builtin(void)
-{
- extern apk_init_func_t __start_initapplets[], __stop_initapplets[];
- apk_init_func_t *p;
-
- list_init(&apk_applet_list);
- for (p = __start_initapplets; p < __stop_initapplets; p++)
- (*p)();
-}
-
struct apk_applet *apk_applet_find(const char *name)
{
struct apk_applet *a;