} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+static void FreeUidThreadExitProc _ANSI_ARGS_((ClientData clientData));
+
/*
* The following tables defines the string values for reliefs, which are
* used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj.
*/
-static char *anchorStrings[] = {"n", "ne", "e", "se", "s", "sw", "w", "nw",
- "center", (char *) NULL};
-static char *justifyStrings[] = {"left", "right", "center", (char *) NULL};
+static CONST char *anchorStrings[] = {
+ "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", (char *) NULL
+};
+static CONST char *justifyStrings[] = {
+ "left", "right", "center", (char *) NULL
+};
\f
/*
int
Tk_GetAnchor(interp, string, anchorPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a direction. */
+ CONST char *string; /* String describing a direction. */
Tk_Anchor *anchorPtr; /* Where to store Tk_Anchor corresponding
* to string. */
{
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfAnchor(anchor)
Tk_Anchor anchor; /* Anchor for which identifying string
* is desired. */
int
Tk_GetJoinStyle(interp, string, joinPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a justification style. */
+ CONST char *string; /* String describing a justification style. */
int *joinPtr; /* Where to store join style corresponding
* to string. */
{
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfJoinStyle(join)
int join; /* Join style for which identifying string
* is desired. */
int
Tk_GetCapStyle(interp, string, capPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a justification style. */
+ CONST char *string; /* String describing a justification style. */
int *capPtr; /* Where to store cap style corresponding
* to string. */
{
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfCapStyle(cap)
int cap; /* Cap style for which identifying string
* is desired. */
int
Tk_GetJustify(interp, string, justifyPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a justification style. */
+ CONST char *string; /* String describing a justification style. */
Tk_Justify *justifyPtr; /* Where to store Tk_Justify corresponding
* to string. */
{
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfJustify(justify)
Tk_Justify justify; /* Justification style for which
* identifying string is desired. */
/*
*----------------------------------------------------------------------
*
+ * FreeUidThreadExitProc --
+ *
+ * Cleans up memory used for Tk_Uids in the thread.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * All information in the identifier table is deleted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+FreeUidThreadExitProc(clientData)
+ ClientData clientData; /* Not used. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_DeleteHashTable(&tsdPtr->uidTable);
+ tsdPtr->initialized = 0;
+}
+\f
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_GetUid --
*
* Given a string, this procedure returns a unique identifier
if (!tsdPtr->initialized) {
Tcl_InitHashTable(tablePtr, TCL_STRING_KEYS);
+ Tcl_CreateThreadExitHandler(FreeUidThreadExitProc, NULL);
tsdPtr->initialized = 1;
}
return (Tk_Uid) Tcl_GetHashKey(tablePtr,
Tk_Window tkwin; /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- char *string; /* String describing a screen distance. */
+ CONST char *string; /* String describing a screen distance. */
double *doublePtr; /* Place to store converted result. */
{
char *end;
Tk_Window tkwin; /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- char *string; /* String describing a number of pixels. */
+ CONST char *string; /* String describing a number of pixels. */
int *intPtr; /* Place to store converted result. */
{
double d;
}
-