---
name: "wl_interface"
section: "3"
platform: "linux"
package: "wayland-docs"
version: "1.26.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/wl_interface"
---

# wl\_interface(3)

## NAME

wl\_interface

## SYNOPSIS

\#include \<wayland-util.h\>

### Data Fields

const char \* **name**\
 int **version**\
 int **method\_count**\
 const struct **wl\_message** \* **methods**\
 int **event\_count**\
 const struct **wl\_message** \* **events**\

## Detailed Description

Protocol object interface

A **wl\_interface** describes the API of a protocol object defined in the Wayland protocol specification. The protocol implementation uses a **wl\_interface** within its marshalling machinery for encoding client requests.

The **name of a wl\_interface is the name of the corresponding protocol interface, and version represents the version of the interface. The members method\_count and event\_count represent the number of methods (requests) and events in the respective wl\_message members.**

**For example, consider a protocol interface** foo**, marked as version** 1**, with two requests and one event.**

```
<interface name="foo" version="1">
  <request name="a"></request>
  <request name="b"></request>
  <event name="c"></event>
</interface>
```

**Given two wl\_message arrays** foo\_requests **and** foo\_events**, a wl\_interface for** foo **might be:**

```
struct wl_interface foo_interface = {
        "foo", 1,
        2, foo_requests,
        1, foo_events
};
```

**Note**

**The server side of the protocol may define interface** *implementation types* **that incorporate the term** interface **in their name. Take care to not confuse these server-side** struct**s with a wl\_interface variable whose name also ends in** interface**. For example, while the server may define a type** struct wl\_foo\_interface**, the client may define a** struct **wl\_interface** wl\_foo\_interface**.**

**See also**

**wl\_message**

**wl\_proxy**

Interfaces

Versioning

## Field Documentation

### int wl\_interface::event\_count

**Number of events**

### const struct wl\_message\* wl\_interface::events

**Event signatures**

### int wl\_interface::method\_count

**Number of methods (requests)**

### const struct wl\_message\* wl\_interface::methods

**Method (request) signatures**

### const char\* wl\_interface::name

**Interface name**

### int wl\_interface::version

**Interface version**

## Author

**Generated automatically by Doxygen for Wayland from the source code.**
