mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-12-26 11:26:05 +00:00
add stringcompare function, fix some returns
This commit is contained in:
parent
f438827263
commit
5b32937f8f
2 changed files with 16 additions and 4 deletions
|
@ -67,7 +67,7 @@ int connect_part(const char *partition){
|
|||
system_part = nx_emmc_part_find(&gpt, partition);
|
||||
if (!system_part) {
|
||||
gfx_errDisplay("connect_mmc_part", ERR_PART_NOT_FOUND, 0);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -81,11 +81,11 @@ int mount_mmc(const char *partition, const int biskeynumb){
|
|||
se_aes_key_set(9, bis_key[biskeynumb] + 0x10, 0x10);
|
||||
|
||||
if (connect_part(partition))
|
||||
return -1;
|
||||
return 1;
|
||||
|
||||
if ((res = f_mount(&emmc, "emmc:", 1))) {
|
||||
gfx_errDisplay("mount_mmc", res, 0);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -65,7 +65,7 @@ int part_printf(){
|
|||
char *toprint;
|
||||
if (parseStringInput(argv[0], &toprint))
|
||||
return -1;
|
||||
|
||||
|
||||
SWAPCOLOR(currentcolor);
|
||||
gfx_printf(toprint);
|
||||
gfx_printf("\n");
|
||||
|
@ -428,6 +428,17 @@ int part_setPrintPos(){
|
|||
return 0;
|
||||
}
|
||||
|
||||
int part_stringcompare(){
|
||||
char *left, *right;
|
||||
|
||||
if (parseStringInput(argv[0], &left))
|
||||
return -1;
|
||||
if (parseStringInput(argv[1], &right))
|
||||
return -1;
|
||||
|
||||
return (strcmp(left, right)) ? 0 : 1;
|
||||
}
|
||||
|
||||
str_fnc_struct functions[] = {
|
||||
{"printf", part_printf, 1},
|
||||
{"printInt", part_print_int, 1},
|
||||
|
@ -441,6 +452,7 @@ str_fnc_struct functions[] = {
|
|||
{"setStringIndex", part_SetStringIndex, 2},
|
||||
{"setColor", part_setColor, 1},
|
||||
{"combineStrings", part_addstrings, 3},
|
||||
{"compareStrings", part_stringcompare, 2},
|
||||
{"invert", part_invert, 1},
|
||||
{"fs_exists", part_fs_exists, 1},
|
||||
{"fs_move", part_fs_Move, 2},
|
||||
|
|
Loading…
Reference in a new issue