Lines Matching refs:linkPtr
64 static char * StringValue _ANSI_ARGS_((Link *linkPtr,
98 Link *linkPtr;
102 linkPtr = (Link *) ckalloc(sizeof(Link));
103 linkPtr->interp = interp;
104 linkPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1));
105 strcpy(linkPtr->varName, varName);
106 linkPtr->addr = addr;
107 linkPtr->type = type & ~TCL_LINK_READ_ONLY;
109 linkPtr->flags = LINK_READ_ONLY;
111 linkPtr->flags = 0;
113 if (Tcl_SetVar(interp, varName, StringValue(linkPtr, buffer),
115 ckfree(linkPtr->varName);
116 ckfree((char *) linkPtr);
121 (ClientData) linkPtr);
123 ckfree(linkPtr->varName);
124 ckfree((char *) linkPtr);
153 Link *linkPtr;
155 linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY,
157 if (linkPtr == NULL) {
162 LinkTraceProc, (ClientData) linkPtr);
163 ckfree(linkPtr->varName);
164 ckfree((char *) linkPtr);
192 Link *linkPtr;
196 linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY,
198 if (linkPtr == NULL) {
201 savedFlag = linkPtr->flags & LINK_BEING_UPDATED;
202 linkPtr->flags |= LINK_BEING_UPDATED;
203 Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
205 linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag;
238 Link *linkPtr = (Link *) clientData;
251 ckfree(linkPtr->varName);
252 ckfree((char *) linkPtr);
254 Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
256 Tcl_TraceVar(interp, linkPtr->varName, TCL_GLOBAL_ONLY
258 LinkTraceProc, (ClientData) linkPtr);
270 if (linkPtr->flags & LINK_BEING_UPDATED) {
280 switch (linkPtr->type) {
283 changed = *(int *)(linkPtr->addr) != linkPtr->lastValue.i;
286 changed = *(double *)(linkPtr->addr) != linkPtr->lastValue.d;
295 Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
310 if (linkPtr->flags & LINK_READ_ONLY) {
311 Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
315 value = Tcl_GetVar(interp, linkPtr->varName, TCL_GLOBAL_ONLY);
325 switch (linkPtr->type) {
327 if (Tcl_GetInt(interp, value, &linkPtr->lastValue.i) != TCL_OK) {
329 Tcl_SetVar(interp, linkPtr->varName,
330 StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY);
333 *(int *)(linkPtr->addr) = linkPtr->lastValue.i;
336 if (Tcl_GetDouble(interp, value, &linkPtr->lastValue.d)
339 Tcl_SetVar(interp, linkPtr->varName,
340 StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY);
343 *(double *)(linkPtr->addr) = linkPtr->lastValue.d;
346 if (Tcl_GetBoolean(interp, value, &linkPtr->lastValue.i)
349 Tcl_SetVar(interp, linkPtr->varName,
350 StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY);
353 *(int *)(linkPtr->addr) = linkPtr->lastValue.i;
356 pp = (char **)(linkPtr->addr);
382 * the value of the C variable given by linkPtr.
391 StringValue(linkPtr, buffer)
392 Link *linkPtr; /* Structure describing linked variable. */
399 switch (linkPtr->type) {
401 linkPtr->lastValue.i = *(int *)(linkPtr->addr);
402 sprintf(buffer, "%d", linkPtr->lastValue.i);
405 linkPtr->lastValue.d = *(double *)(linkPtr->addr);
406 Tcl_PrintDouble(linkPtr->interp, linkPtr->lastValue.d, buffer);
409 linkPtr->lastValue.i = *(int *)(linkPtr->addr);
410 if (linkPtr->lastValue.i != 0) {
415 p = *(char **)(linkPtr->addr);