mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-09 13:41:45 +00:00
Add fs_combinePath()
This commit is contained in:
parent
744f90611a
commit
8832b240a4
2 changed files with 21 additions and 1 deletions
|
@ -446,6 +446,22 @@ int part_stringcompare(){
|
|||
return (strcmp(left, right)) ? 0 : 1;
|
||||
}
|
||||
|
||||
int part_fs_combinePath(){
|
||||
char *combined, *left, *middle;
|
||||
if (parseStringInput(argv[0], &left))
|
||||
return -1;
|
||||
if (parseStringInput(argv[1], &middle))
|
||||
return -1;
|
||||
if (argv[2][0] != '$')
|
||||
return -1;
|
||||
|
||||
combined = fsutil_getnextloc(left, middle);
|
||||
|
||||
str_str_add(argv[2], combined);
|
||||
free(combined);
|
||||
return 0;
|
||||
}
|
||||
|
||||
str_fnc_struct functions[] = {
|
||||
{"printf", part_printf, 1},
|
||||
{"printInt", part_print_int, 1},
|
||||
|
@ -471,6 +487,7 @@ str_fnc_struct functions[] = {
|
|||
{"fs_openDir", part_fs_OpenDir, 1},
|
||||
{"fs_closeDir", part_fs_CloseDir, 0},
|
||||
{"fs_readDir", part_fs_ReadDir, 0},
|
||||
{"fs_combinePath", part_fs_combinePath, 3},
|
||||
{"mmc_connect", part_ConnectMMC, 1},
|
||||
{"mmc_mount", part_MountMMC, 1},
|
||||
{"pause", part_Pause, 0},
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "../fs/fsreader.h"
|
||||
|
||||
#include "../utils/utils.h"
|
||||
|
||||
u32 countchars(char* in, char target) {
|
||||
u32 len = strlen(in);
|
||||
|
@ -267,10 +267,12 @@ extern u32 currentcolor;
|
|||
extern char *currentpath;
|
||||
void runScript(char *path){
|
||||
int res;
|
||||
char *path_local = NULL;
|
||||
forceExit = false;
|
||||
currentchar = 0;
|
||||
currentcolor = COLOR_WHITE;
|
||||
gfx_clearscreen();
|
||||
utils_copystring(path, &path_local);
|
||||
|
||||
res = f_open(&scriptin, path, FA_READ | FA_OPEN_EXISTING);
|
||||
if (res != FR_OK){
|
||||
|
@ -301,5 +303,6 @@ void runScript(char *path){
|
|||
str_int_clear();
|
||||
str_jmp_clear();
|
||||
str_str_clear();
|
||||
free(path_local);
|
||||
//btn_wait();
|
||||
}
|
Loading…
Reference in a new issue