mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-08 13:11:54 +00:00
add esc/combine path
This commit is contained in:
parent
e42cc4c8eb
commit
beb6b1ec33
1 changed files with 27 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
#include "scriptError.h"
|
||||
#include <string.h>
|
||||
#include "dictionaryClass.h"
|
||||
#include "StringClass.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#include "../storage/mountmanager.h"
|
||||
|
@ -428,6 +429,30 @@ ClassFunction(stdEmummcFileWrite){
|
|||
return newIntVariablePtr(emmcFile(args[0]->string.value, args[1]->string.value, MMC_CONN_EMUMMC, 1));
|
||||
}
|
||||
|
||||
ClassFunction(stdCombinePaths){
|
||||
if (argsLen < 2 || args[0]->variableType != StringClass){
|
||||
SCRIPT_FATAL_ERR("stdCombinePaths needs 2+ args");
|
||||
}
|
||||
|
||||
char *res = CpyStr(args[0]->string.value);
|
||||
|
||||
for (int i = 1; i < argsLen; i++){
|
||||
if (args[i]->variableType != StringClass){
|
||||
SCRIPT_FATAL_ERR("stdCombinePaths needs 2+ args");
|
||||
}
|
||||
|
||||
char *temp = CombinePaths(res, args[i]->string.value);
|
||||
free(res);
|
||||
res = temp;
|
||||
}
|
||||
|
||||
return newStringVariablePtr(res, 0, 1);
|
||||
}
|
||||
|
||||
ClassFunction(stdEscPaths){
|
||||
return newStringVariablePtr(EscapeFolder(args[0]->string.value), 0, 1);
|
||||
}
|
||||
|
||||
#else
|
||||
#define STUBBED(name) ClassFunction(name) { return newIntVariablePtr(0); }
|
||||
|
||||
|
@ -539,6 +564,8 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
|||
// Utils
|
||||
{"fsexists", stdFileExists, 1, twoStringArgStd},
|
||||
{"payload", stdLaunchPayload, 1, twoStringArgStd},
|
||||
{"combinepath", stdCombinePaths, VARARGCOUNT, 0},
|
||||
{"escapepath", stdEscPaths, 1, twoStringArgStd},
|
||||
};
|
||||
|
||||
ClassFunctionTableEntry_t* searchStdLib(char* funcName, u8 *len) {
|
||||
|
|
Loading…
Reference in a new issue