libweston: Properly namespace modules entrypoint

Use different functions so we cannot load a libweston common module in
weston directly or the other way around.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Quentin Glidic 8 years ago
parent 23e1d6f176
commit 3d7ca3b9ea
No known key found for this signature in database
GPG Key ID: AC203F96E2C34BB7
  1. 1
      compositor/cms-colord.c
  2. 1
      compositor/systemd-notify.c
  3. 4
      compositor/weston.h
  4. 1
      fullscreen-shell/fullscreen-shell.c
  5. 8
      libweston/compositor.c
  6. 3
      libweston/compositor.h
  7. 1
      tests/plugin-registry-test.c
  8. 1
      tests/surface-global-test.c
  9. 1
      tests/surface-screenshot.c
  10. 1
      tests/surface-test.c
  11. 3
      xwayland/launcher.c

@ -34,6 +34,7 @@
#include <colord.h> #include <colord.h>
#include "compositor.h" #include "compositor.h"
#include "weston.h"
#include "cms-helper.h" #include "cms-helper.h"
#include "shared/helpers.h" #include "shared/helpers.h"

@ -34,6 +34,7 @@
#include "shared/string-helpers.h" #include "shared/string-helpers.h"
#include "shared/zalloc.h" #include "shared/zalloc.h"
#include "compositor.h" #include "compositor.h"
#include "weston.h"
struct systemd_notifier { struct systemd_notifier {
int watchdog_time; int watchdog_time;

@ -63,6 +63,10 @@ wet_get_config(struct weston_compositor *compositor);
void * void *
wet_load_module(const char *name, const char *entrypoint); wet_load_module(const char *name, const char *entrypoint);
int
module_init(struct weston_compositor *compositor,
int *argc, char *argv[]);
int int
wet_load_xwayland(struct weston_compositor *comp); wet_load_xwayland(struct weston_compositor *comp);

@ -34,6 +34,7 @@
#include <assert.h> #include <assert.h>
#include "compositor.h" #include "compositor.h"
#include "compositor/weston.h"
#include "fullscreen-shell-unstable-v1-server-protocol.h" #include "fullscreen-shell-unstable-v1-server-protocol.h"
#include "shared/helpers.h" #include "shared/helpers.h"

@ -5409,14 +5409,12 @@ weston_compositor_load_backend(struct weston_compositor *compositor,
WL_EXPORT int WL_EXPORT int
weston_compositor_load_xwayland(struct weston_compositor *compositor) weston_compositor_load_xwayland(struct weston_compositor *compositor)
{ {
int (*module_init)(struct weston_compositor *ec, int (*module_init)(struct weston_compositor *ec);
int *argc, char *argv[]);
int argc = 0;
module_init = weston_load_module("xwayland.so", "module_init"); module_init = weston_load_module("xwayland.so", "weston_module_init");
if (!module_init) if (!module_init)
return -1; return -1;
if (module_init(compositor, &argc, NULL) < 0) if (module_init(compositor) < 0)
return -1; return -1;
return 0; return 0;
} }

@ -1818,8 +1818,7 @@ int
weston_backend_init(struct weston_compositor *c, weston_backend_init(struct weston_compositor *c,
struct weston_backend_config *config_base); struct weston_backend_config *config_base);
int int
module_init(struct weston_compositor *compositor, weston_module_init(struct weston_compositor *compositor);
int *argc, char *argv[]);
void void
weston_transformed_coord(int width, int height, weston_transformed_coord(int width, int height,

@ -28,6 +28,7 @@
#include <assert.h> #include <assert.h>
#include "compositor.h" #include "compositor.h"
#include "compositor/weston.h"
#include "plugin-registry.h" #include "plugin-registry.h"
static void static void

@ -29,6 +29,7 @@
#include <stdint.h> #include <stdint.h>
#include "compositor.h" #include "compositor.h"
#include "compositor/weston.h"
static void static void
surface_to_from_global(void *data) surface_to_from_global(void *data)

@ -34,6 +34,7 @@
#include <linux/input.h> #include <linux/input.h>
#include "compositor.h" #include "compositor.h"
#include "compositor/weston.h"
#include "file-util.h" #include "file-util.h"
static char * static char *

@ -29,6 +29,7 @@
#include <assert.h> #include <assert.h>
#include "compositor.h" #include "compositor.h"
#include "compositor/weston.h"
static void static void
surface_transform(void *data) surface_transform(void *data)

@ -351,8 +351,7 @@ const struct weston_xwayland_api api = {
extern const struct weston_xwayland_surface_api surface_api; extern const struct weston_xwayland_surface_api surface_api;
WL_EXPORT int WL_EXPORT int
module_init(struct weston_compositor *compositor, weston_module_init(struct weston_compositor *compositor)
int *argc, char *argv[])
{ {
struct wl_display *display = compositor->wl_display; struct wl_display *display = compositor->wl_display;

Loading…
Cancel
Save