1. NAME

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

2. SYNTAX

int XSaveContext(Display *display, XID rid, XContext context, XPointer data); int XFindContext(Display *display, XID rid, XContext context, XPointer *data_return); int XDeleteContext(Display *display, XID rid, XContext context);

XContext XUniqueContext(void);

3. ARGUMENTS

context 1i Specifies the context type to which the data belongs.

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

data_return 1i Returns the data.

display 1i Specifies the connection to the X server.

rid 1i Specifies the resource ID with which the data is associated.

4. DESCRIPTION

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

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

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

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

5. SEE ALSO

\*(xL