weston: Properly namespace modules entrypoint

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Quentin Glidic 8 years ago
parent 3d7ca3b9ea
commit 8af2beccbd
No known key found for this signature in database
GPG Key ID: AC203F96E2C34BB7
  1. 2
      compositor/cms-colord.c
  2. 2
      compositor/cms-static.c
  3. 27
      compositor/main.c
  4. 2
      compositor/screen-share.c
  5. 2
      compositor/systemd-notify.c
  6. 9
      compositor/weston.h
  7. 2
      desktop-shell/shell.c
  8. 2
      fullscreen-shell/fullscreen-shell.c
  9. 4
      ivi-shell/ivi-layout.c
  10. 2
      ivi-shell/ivi-shell.c
  11. 3
      tests/plugin-registry-test.c
  12. 3
      tests/surface-global-test.c
  13. 2
      tests/surface-screenshot.c
  14. 3
      tests/surface-test.c
  15. 2
      tests/weston-test.c

@ -496,7 +496,7 @@ colord_cms_output_destroy(gpointer data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *ec, wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
gboolean ret; gboolean ret;

@ -91,7 +91,7 @@ cms_notifier_destroy(struct wl_listener *listener, void *data)
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *ec, wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct cms_static *cms; struct cms_static *cms;

@ -761,7 +761,7 @@ weston_create_listening_socket(struct wl_display *display, const char *socket_na
} }
WL_EXPORT void * WL_EXPORT void *
wet_load_module(const char *name, const char *entrypoint) wet_load_module_entrypoint(const char *name, const char *entrypoint)
{ {
const char *builddir = getenv("WESTON_BUILD_DIR"); const char *builddir = getenv("WESTON_BUILD_DIR");
char path[PATH_MAX]; char path[PATH_MAX];
@ -812,14 +812,28 @@ wet_load_module(const char *name, const char *entrypoint)
return init; return init;
} }
WL_EXPORT int
wet_load_module(struct weston_compositor *compositor,
const char *name, int *argc, char *argv[])
{
int (*module_init)(struct weston_compositor *ec,
int *argc, char *argv[]);
module_init = wet_load_module_entrypoint(name, "wet_module_init");
if (!module_init)
return -1;
if (module_init(compositor, argc, argv) < 0)
return -1;
return 0;
}
static int static int
load_modules(struct weston_compositor *ec, const char *modules, load_modules(struct weston_compositor *ec, const char *modules,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
const char *p, *end; const char *p, *end;
char buffer[256]; char buffer[256];
int (*module_init)(struct weston_compositor *ec,
int *argc, char *argv[]);
if (modules == NULL) if (modules == NULL)
return 0; return 0;
@ -833,16 +847,13 @@ load_modules(struct weston_compositor *ec, const char *modules,
if (wet_load_xwayland(ec) < 0) if (wet_load_xwayland(ec) < 0)
return -1; return -1;
} else { } else {
module_init = wet_load_module(buffer, "module_init"); if (wet_load_module(ec, buffer, argc, argv) < 0)
if (!module_init)
return -1;
if (module_init(ec, argc, argv) < 0)
return -1; return -1;
} }
p = end; p = end;
while (*p == ',') while (*p == ',')
p++; p++;
} }
return 0; return 0;

@ -1106,7 +1106,7 @@ share_output_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t k
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct screen_share *ss; struct screen_share *ss;

@ -115,7 +115,7 @@ weston_compositor_destroy_listener(struct wl_listener *listener, void *data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
char *watchdog_time_env; char *watchdog_time_env;

@ -61,7 +61,14 @@ struct weston_config *
wet_get_config(struct weston_compositor *compositor); wet_get_config(struct weston_compositor *compositor);
void * void *
wet_load_module(const char *name, const char *entrypoint); wet_load_module_entrypoint(const char *name, const char *entrypoint);
int
wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[]);
int
wet_load_module(struct weston_compositor *compositor,
const char *name, int *argc, char *argv[]);
int int
module_init(struct weston_compositor *compositor, module_init(struct weston_compositor *compositor,

@ -4874,7 +4874,7 @@ handle_seat_created(struct wl_listener *listener, void *data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *ec, wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct weston_seat *seat; struct weston_seat *seat;

@ -897,7 +897,7 @@ bind_fullscreen_shell(struct wl_client *client, void *data, uint32_t version,
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct fullscreen_shell *shell; struct fullscreen_shell *shell;

@ -2120,7 +2120,9 @@ load_controller_modules(struct weston_compositor *compositor, const char *module
end = strchrnul(p, ','); end = strchrnul(p, ',');
snprintf(buffer, sizeof buffer, "%.*s", (int)(end - p), p); snprintf(buffer, sizeof buffer, "%.*s", (int)(end - p), p);
controller_module_init = wet_load_module(buffer, "controller_module_init"); controller_module_init =
wet_load_module_entrypoint(buffer,
"controller_module_init");
if (!controller_module_init) if (!controller_module_init)
return -1; return -1;

@ -492,7 +492,7 @@ shell_add_bindings(struct weston_compositor *compositor,
* Initialization of ivi-shell. * Initialization of ivi-shell.
*/ */
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct ivi_shell *shell; struct ivi_shell *shell;

@ -89,7 +89,8 @@ runtime_tests(void *data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, int *argc, char *argv[]) wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[])
{ {
struct wl_event_loop *loop; struct wl_event_loop *loop;

@ -80,7 +80,8 @@ surface_to_from_global(void *data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, int *argc, char *argv[]) wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[])
{ {
struct wl_event_loop *loop; struct wl_event_loop *loop;

@ -214,7 +214,7 @@ out:
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *ec, wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
weston_compositor_add_debug_binding(ec, KEY_H, trigger_binding, ec); weston_compositor_add_debug_binding(ec, KEY_H, trigger_binding, ec);

@ -61,7 +61,8 @@ surface_transform(void *data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, int *argc, char *argv[]) wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[])
{ {
struct wl_event_loop *loop; struct wl_event_loop *loop;

@ -585,7 +585,7 @@ idle_launch_client(void *data)
} }
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *ec, wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct weston_test *test; struct weston_test *test;

Loading…
Cancel
Save