// boolean NameSpace.load(String path); static KMETHOD NameSpace_loadScript(KonohaContext *kctx, KonohaStack *sfp) { char pathbuf[512]; const char *path = PLATAPI formatTransparentPath(pathbuf, sizeof(pathbuf), FileId_t(sfp[K_RTNIDX].calledFileLine), S_text(sfp[1].asString)); KMakeTrace(trace, sfp); kNameSpace_LoadScript(kctx, sfp[0].asNameSpace, path, trace); }
//## @Const String File.scriptPath(String path); static KMETHOD File_scriptPath(KonohaContext *kctx, KonohaStack *sfp) { char scriptPathBuf[K_PATHMAX]; const char *scriptPath = PLATAPI formatTransparentPath(scriptPathBuf, sizeof(scriptPathBuf), KFileLine_textFileName(sfp[K_RTNIDX].calledFileLine), kString_text(sfp[1].asString)); kStringVar *resultValue = (kStringVar *)KLIB new_kString(kctx, OnStack, scriptPath, strlen(scriptPath), 0); if(kString_Is(Literal, sfp[1].asString)) { kString_Set(Literal, resultValue, true); } KReturn(resultValue); }