summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authorstanton <stanton>1998-09-24 23:58:14 (GMT)
committerstanton <stanton>1998-09-24 23:58:14 (GMT)
commit9995355714bc90faf7c2e345b3d6a1d041447097 (patch)
tree2ad97c5b1994495118cef4df947cf16b55e326f2 /generic/tclUtil.c
parente13392595faf8e8d0d1c3c514ce160cfadc3d372 (diff)
downloadtcl-9995355714bc90faf7c2e345b3d6a1d041447097.zip
tcl-9995355714bc90faf7c2e345b3d6a1d041447097.tar.gz
tcl-9995355714bc90faf7c2e345b3d6a1d041447097.tar.bz2
merging changes from 8.0.3 into 8.1a2
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index aa9b0d7..1c2338b 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -10,13 +10,22 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * SCCS: @(#) tclUtil.c 1.178 98/02/19 11:51:59
+ * RCS: @(#) $Id: tclUtil.c,v 1.1.2.2 1998/09/24 23:59:04 stanton Exp $
*/
#include "tclInt.h"
#include "tclPort.h"
/*
+ * The following variable holds the full path name of the binary
+ * from which this application was executed, or NULL if it isn't
+ * know. The value of the variable is set by the procedure
+ * Tcl_FindExecutable. The storage space is dynamically allocated.
+ */
+
+char *tclExecutableName = NULL;
+
+/*
* The following values are used in the flags returned by Tcl_ScanElement
* and used by Tcl_ConvertElement. The value TCL_DONT_USE_BRACES is also
* defined in tcl.h; make sure its value doesn't overlap with any of the
@@ -2048,3 +2057,30 @@ TclGetIntForIndex(interp, objPtr, endValue, indexPtr)
*indexPtr = index;
return TCL_OK;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_GetNameOfExecutable --
+ *
+ * This procedure simply returns a pointer to the internal full
+ * path name of the executable file as computed by
+ * Tcl_FindExecutable. This procedure call is the C API
+ * equivalent to the "info nameofexecutable" command.
+ *
+ * Results:
+ * A pointer to the internal string or NULL if the internal full
+ * path name has not been computed or unknown.
+ *
+ * Side effects:
+ * The object referenced by "objPtr" might be converted to an
+ * integer object.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CONST char *
+Tcl_GetNameOfExecutable()
+{
+ return (tclExecutableName);
+}