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>
This commit is contained in:
parent
23e1d6f176
commit
3d7ca3b9ea
|
@ -34,6 +34,7 @@
|
|||
#include <colord.h>
|
||||
|
||||
#include "compositor.h"
|
||||
#include "weston.h"
|
||||
#include "cms-helper.h"
|
||||
#include "shared/helpers.h"
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "shared/string-helpers.h"
|
||||
#include "shared/zalloc.h"
|
||||
#include "compositor.h"
|
||||
#include "weston.h"
|
||||
|
||||
struct systemd_notifier {
|
||||
int watchdog_time;
|
||||
|
|
|
@ -63,6 +63,10 @@ wet_get_config(struct weston_compositor *compositor);
|
|||
void *
|
||||
wet_load_module(const char *name, const char *entrypoint);
|
||||
|
||||
int
|
||||
module_init(struct weston_compositor *compositor,
|
||||
int *argc, char *argv[]);
|
||||
|
||||
int
|
||||
wet_load_xwayland(struct weston_compositor *comp);
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "compositor.h"
|
||||
#include "compositor/weston.h"
|
||||
#include "fullscreen-shell-unstable-v1-server-protocol.h"
|
||||
#include "shared/helpers.h"
|
||||
|
||||
|
|
|
@ -5409,14 +5409,12 @@ weston_compositor_load_backend(struct weston_compositor *compositor,
|
|||
WL_EXPORT int
|
||||
weston_compositor_load_xwayland(struct weston_compositor *compositor)
|
||||
{
|
||||
int (*module_init)(struct weston_compositor *ec,
|
||||
int *argc, char *argv[]);
|
||||
int argc = 0;
|
||||
int (*module_init)(struct weston_compositor *ec);
|
||||
|
||||
module_init = weston_load_module("xwayland.so", "module_init");
|
||||
module_init = weston_load_module("xwayland.so", "weston_module_init");
|
||||
if (!module_init)
|
||||
return -1;
|
||||
if (module_init(compositor, &argc, NULL) < 0)
|
||||
if (module_init(compositor) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1818,8 +1818,7 @@ int
|
|||
weston_backend_init(struct weston_compositor *c,
|
||||
struct weston_backend_config *config_base);
|
||||
int
|
||||
module_init(struct weston_compositor *compositor,
|
||||
int *argc, char *argv[]);
|
||||
weston_module_init(struct weston_compositor *compositor);
|
||||
|
||||
void
|
||||
weston_transformed_coord(int width, int height,
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "compositor.h"
|
||||
#include "compositor/weston.h"
|
||||
#include "plugin-registry.h"
|
||||
|
||||
static void
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "compositor.h"
|
||||
#include "compositor/weston.h"
|
||||
|
||||
static void
|
||||
surface_to_from_global(void *data)
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/input.h>
|
||||
|
||||
#include "compositor.h"
|
||||
#include "compositor/weston.h"
|
||||
#include "file-util.h"
|
||||
|
||||
static char *
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "compositor.h"
|
||||
#include "compositor/weston.h"
|
||||
|
||||
static void
|
||||
surface_transform(void *data)
|
||||
|
|
|
@ -351,8 +351,7 @@ const struct weston_xwayland_api api = {
|
|||
extern const struct weston_xwayland_surface_api surface_api;
|
||||
|
||||
WL_EXPORT int
|
||||
module_init(struct weston_compositor *compositor,
|
||||
int *argc, char *argv[])
|
||||
weston_module_init(struct weston_compositor *compositor)
|
||||
|
||||
{
|
||||
struct wl_display *display = compositor->wl_display;
|
||||
|
|
Loading…
Reference in New Issue