summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorsuresh <suresh@noemail.net>1998-06-12 16:49:08 (GMT)
committersuresh <suresh@noemail.net>1998-06-12 16:49:08 (GMT)
commit7fa3636f72225485683d2ccb00c5497df8e68e50 (patch)
treecbf74d7a2d8e0bab6e7c0eb453a4cffc331856b6 /generic
parente0305f0450677b0c77a3c6d6aa8d92e898819519 (diff)
downloadtcl-7fa3636f72225485683d2ccb00c5497df8e68e50.zip
tcl-7fa3636f72225485683d2ccb00c5497df8e68e50.tar.gz
tcl-7fa3636f72225485683d2ccb00c5497df8e68e50.tar.bz2
Moved the definition of "char *tclExecutableName" to this file.
Added implementation for the new public routine 'Tcl_GetNameOfExecutable(...)'. FossilOrigin-Name: 21d0cf46bc78606ef2264e45843364e2d76b836c
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtil.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index e43482f..dc4dd20 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.161 97/08/12 17:07:18
+ * SCCS: %Z% $Id: tclUtil.c,v 1.2 1998/06/12 16:49:08 suresh 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
@@ -2805,3 +2814,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);
+}