XSaveContext(3) XLIB FUNCTIONS XSaveContext(3)

# [NAME](#NAME)

XSaveContext, XFindContext, XDeleteContext, XUniqueContext - associative look-up routines

# [SYNTAX](#SYNTAX)

int XSaveContext(Display \**display*, XID *rid*, XContext *context*, \_Xconst char \**data*);

int XFindContext(Display \**display*, XID *rid*, XContext *context*, XPointer \**data\_return*);

int XDeleteContext(Display \**display*, XID *rid*, XContext *context*);

XContext XUniqueContext(void);

# [ARGUMENTS](#ARGUMENTS)

[*context*](#context)

Specifies the context type to which the data belongs.

[*data*](#data)

Specifies the data to be associated with the window and type.

[*data\_return*](#data_return)

Returns the data.

[*display*](#display)

Specifies the connection to the X server.

[*rid*](#rid)

Specifies the resource ID with which the data is associated.

# [DESCRIPTION](#DESCRIPTION)

If an entry with the specified resource ID and type already exists, **XSaveContext** overrides it with the specified context. The **XSaveContext** function returns a nonzero error code if an error has occurred and zero otherwise. Possible errors are **XCNOMEM** (out of memory).

Because it is a return value, the data is a pointer. The **XFindContext** function returns a nonzero error code if an error has occurred and zero otherwise. Possible errors are **XCNOENT** (context-not-found).

The **XDeleteContext** function deletes the entry for the given resource ID and type from the data structure. This function returns the same error codes that **XFindContext** returns if called with the same arguments. **XDeleteContext** does not free the data whose address was saved.

The **XUniqueContext** function creates a unique context type that may be used in subsequent calls to **XSaveContext**.

# [SEE ALSO](#SEE_ALSO)

*Xlib - C Language X Interface*

libX11 1.8.14 X Version 11

---

Document: XFindContext(3) from libx11 1.8.14-r2 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libx11.git
