summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixXId.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2001-09-25 16:25:20 (GMT)
committerdgp <dgp@users.sourceforge.net>2001-09-25 16:25:20 (GMT)
commitac859f541ab22b0778aa06864848fdf336bb49cf (patch)
tree6e45150fb4ffc49a55a84c473b393c1b01745056 /unix/tkUnixXId.c
parent8fa92e5eb08f440c8993da8965ab7e0e17b173b8 (diff)
downloadtk-ac859f541ab22b0778aa06864848fdf336bb49cf.zip
tk-ac859f541ab22b0778aa06864848fdf336bb49cf.tar.gz
tk-ac859f541ab22b0778aa06864848fdf336bb49cf.tar.bz2
* Corrected definition of
TkpScanWindowId to handle situation where types Window and int do not have the same number of bits. CONST-ified too.
Diffstat (limited to 'unix/tkUnixXId.c')
-rw-r--r--unix/tkUnixXId.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 6312d3a..c2be145 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixXId.c,v 1.5 1999/04/21 21:53:32 rjohnson Exp $
+ * RCS: @(#) $Id: tkUnixXId.c,v 1.6 2001/09/25 16:25:20 dgp Exp $
*/
/*
@@ -534,3 +534,37 @@ TkpWindowWasRecentlyDeleted(win, dispPtr)
}
return 0;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpScanWindowId --
+ *
+ * Given a string, produce the corresponding Window Id.
+ *
+ * Results:
+ * The return value is normally TCL_OK; in this case *idPtr
+ * will be set to the Window value equivalent to string. If
+ * string is improperly formed then TCL_ERROR is returned and
+ * an error message will be left in the interp's result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpScanWindowId(interp, string, idPtr)
+ Tcl_Interp *interp;
+ CONST char *string;
+ Window *idPtr;
+{
+ int value;
+ if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ *idPtr = (Window) value;
+ return TCL_OK;
+}
+