在 wayland 源代码中,我找不到在哪个文件中定义了变量

in wayland source code, I cannot find in which file, variable is defined

这是

提出的问题

从上一个问题中,我发现 "wl_compositor_interface" 在头文件 "wayland-server-protocol.h"."wayland-server-protocol.h" 中用作结构标记和变量。

struct wl_compositor_interface {
         void (*create_surface)(struct wl_client *client,
                                struct wl_resource *resource,
                                uint32_t id);
         void (*create_region)(struct wl_client *client,
                               struct wl_resource *resource,
                               uint32_t id);
 };


extern const struct wl_interface wl_compositor_interface;

然而,头文件只是将变量声明为 extern const struct wl_interface wl_compositor_interface; 我找不到变量定义的位置。类似地,所有具有模式 "wl_***_interface 的变量都在头文件中声明但没有定义。 有人可以帮我找到定义吗? 韦兰源在这里 wayland github

我也看了文档,没有关于wl_***_interface的描述

这是因为 struct wl_interface wl_compositor_interface - 在绑定到 wl_compositor 全局时必须使用 - 在生成的协议代码中,通常在 $SRC/protocol/wayland-protocol.c.

struct wl_compositor_interface 是合成器用来注册函数的结构,它将接收来自客户端的请求(对于它自己的 wl_resource 结构,表示客户端看到的合成器全局)。