Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData − manage associations of string keys and user specified data with Tcl interpreters


#include <tcl.h>

(interp, key, delProcPtr)

Tcl_SetAssocData(interp, key, delProc, clientData)

Tcl_DeleteAssocData(interp, key)


Tcl_Interp *interp (in)

Interpreter in which to execute the specified command.

const char *key (in)

Key for association with which to store data or from which to delete or retrieve data. Typically the module prefix for a package.

Tcl_InterpDeleteProc *delProc (in)

Procedure to call when interp is deleted.

Tcl_InterpDeleteProc **delProcPtr (in)

Pointer to location in which to store address of current deletion procedure for association. Ignored if NULL.

ClientData clientData (in)

Arbitrary one-word value associated with the given key in this interpreter. This data is owned by the caller.



These procedures allow extensions to associate their own data with a Tcl interpreter. An association consists of a string key, typically the name of the extension, and a one-word value, which is typically a pointer to a data structure holding data specific to the extension. Tcl makes no interpretation of either the key or the value for an association.

Storage management is facilitated by storing with each association a procedure to call when the interpreter is deleted. This procedure can dispose of the storage occupied by the client’s data in any way it sees fit.

Tcl_SetAssocData creates an association between a string key and a user specified datum in the given interpreter. If there is already an association with the given key, Tcl_SetAssocData overwrites it with the new information. It is up to callers to organize their use of names to avoid conflicts, for example, by using package names as the keys. If the deleteProc argument is non-NULL it specifies the address of a procedure to invoke if the interpreter is deleted before the association is deleted. DeleteProc should have arguments and result that match the type Tcl_InterpDeleteProc:

typedef void Tcl_InterpDeleteProc(
ClientData clientData,
Tcl_Interp *interp);

When deleteProc is invoked the clientData and interp arguments will be the same as the corresponding arguments passed to Tcl_SetAssocData. The deletion procedure will not be invoked if the association is deleted before the interpreter is deleted.

Tcl_GetAssocData returns the datum stored in the association with the specified key in the given interpreter, and if the delProcPtr field is non-NULL, the address indicated by it gets the address of the delete procedure stored with this association. If no association with the specified key exists in the given interpreter Tcl_GetAssocData returns NULL.

Tcl_DeleteAssocData deletes an association with a specified key in the given interpreter. Then it calls the deletion procedure.


association, data, deletion procedure, interpreter, key

More Linux Commands

Ttk_GetPaddingFromObj(3) - Tk themed geometry utilities.....
The Ttk_Box structure represents a rectangular region of a window: typedef struct { int x; int y; int width; int height; } Ttk_Box; All coordinates are relative

wcpcpy(3) - copy a wide-character string, returning a pointe
The wcpcpy() function is the wide-character equivalent of the stpcpy(3) function. It copies the wide-character string pointed to by src, including the terminati

Mail::SpamAssassin::SQLBasedAddrList(3pm) - SpamAssassin SQL
A SQL based persistent address list implementation. See Mail::SpamAssassin::PersistentAddrList for more information. Uses DBI::DBD module access to your favorit

svcerr_weakauth(3) - library routines for remote procedure c
These routines allow C programs to make procedure calls on other machines across the network. First, the client calls a procedure to send a data packet to the s

ttk_image(n) - Define an element based on an image (ManPage)
The image element factory creates a new element in the current theme whose visual appearance is determined by Tk images. imageSpec is a list of one or more elem

XMapRaised(3) - map windows (Library - Linux man page)......
The XMapWindow function maps the window and all of its subwindows that have had map requests. Mapping a window that has an unmapped ancestor does not display th

pop3test(1) - interactive POP3 test program - Linux man page
pop3test is a utility that allows you to authenticate to a POP3 server and interactively issue commands to it. Once authenticated you may issue any POP3 command

gnutls_x509_crq_get_dn_by_oid(3) - API function (Man Page)
This function will extract the part of the name of the Certificate request subject, specified by the given OID. The output will be encoded as described in RFC22

TAILQ_ENTRY(3) implementations of lists, tail queues, and ci
These macros define and operate on three types of data structures: lists, tail queues, and circular queues. All three structures support the following functiona

atan2l(3) - arc tangent function of two variables (ManPage)
The atan2() function calculates the principal value of the arc tangent of y/x, using the signs of the two arguments to determine the quadrant of the result. RET

Net::SSLeay::Handle(3pm) - Perl module that lets SSL (HTTPS)
Net::SSLeay::Handle allows you to request and receive HTTPS web pages using old-fashion file handles as in: print SSL GET / HTTP/1.0\r\n; and print while (&lt;SSL&gt;

FcConfigBuildFonts(3) - Build font database - Linux man page
Builds the set of available fonts for the given configuration. Note that any changes to the configuration after this call have indeterminate effects. Returns Fc

We can't live, work or learn in freedom unless the software we use is free.