diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclUtil.c | 38 |
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); +} |