MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / getInterpPWD

Function getInterpPWD

SRC/tcl/commands.cpp:9766–9793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9764
9765
9766const char * getInterpPWD(Tcl_Interp *interp) {
9767 static char *pwd = 0;
9768
9769 if (pwd != 0)
9770 delete [] pwd;
9771
9772#ifdef _TCL84
9773 Tcl_Obj *cwd = Tcl_FSGetCwd(interp);
9774 if (cwd != NULL) {
9775 int length;
9776 const char *objPWD = Tcl_GetStringFromObj(cwd, &length);
9777 pwd = new char[length+1];
9778 strcpy(pwd, objPWD);
9779 Tcl_DecrRefCount(cwd);
9780 }
9781#else
9782
9783 Tcl_DString buf;
9784 const char *objPWD = Tcl_GetCwd(interp, &buf);
9785
9786 pwd = new char[strlen(objPWD)+1];
9787 strcpy(pwd, objPWD);
9788
9789 Tcl_DStringFree(&buf);
9790
9791#endif
9792 return pwd;
9793}
9794
9795
9796int

Callers 7

OPS_SourceCmdFunction · 0.70
logFileFunction · 0.70
EvalFileWithParametersFunction · 0.70
TclCommand_addNodalLoadFunction · 0.50
TclPatternCommandFunction · 0.50
OPS_GetInterpPWDFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected