Comment out file path code

This commit is contained in:
mwalker33 2020-04-25 18:37:23 +10:00
commit a8ff7b4815
4 changed files with 20 additions and 18 deletions

View file

@ -192,6 +192,7 @@ bool create_path(const char *dirname) {
return true; return true;
} }
*/ */
/*
bool setDefaultPath (savePaths_t pathIndex,const char *Path) { bool setDefaultPath (savePaths_t pathIndex,const char *Path) {
if (pathIndex < spItemCount) { if (pathIndex < spItemCount) {
@ -210,7 +211,7 @@ bool setDefaultPath (savePaths_t pathIndex,const char *Path) {
return true; return true;
} }
*/
static char *filenamemcopy(const char *preferredName, const char *suffix) { static char *filenamemcopy(const char *preferredName, const char *suffix) {
if (preferredName == NULL) return NULL; if (preferredName == NULL) return NULL;
if (suffix == NULL) return NULL; if (suffix == NULL) return NULL;

View file

@ -75,7 +75,7 @@ typedef enum {
int fileExists(const char *filename); int fileExists(const char *filename);
//bool create_path(const char *dirname); //bool create_path(const char *dirname);
bool setDefaultPath (savePaths_t pathIndex,const char *Path); // set a path in the path list session.defaultPaths //bool setDefaultPath (savePaths_t pathIndex,const char *Path); // set a path in the path list session.defaultPaths
/** /**

View file

@ -65,9 +65,9 @@ int preferences_load(void) {
session.show_hints = false; session.show_hints = false;
session.supports_colors = false; session.supports_colors = false;
setDefaultPath (spDefault, ""); // setDefaultPath (spDefault, "");
setDefaultPath (spDump, ""); // setDefaultPath (spDump, "");
setDefaultPath (spTrace, ""); // setDefaultPath (spTrace, "");
/* /*
// default save path // default save path
@ -172,9 +172,9 @@ void preferences_save_callback(json_t *root) {
JsonSaveBoolean(root, "os.supports.colors", session.supports_colors); JsonSaveBoolean(root, "os.supports.colors", session.supports_colors);
JsonSaveStr(root, "file.default.savepath", session.defaultPaths[spDefault]); // JsonSaveStr(root, "file.default.savepath", session.defaultPaths[spDefault]);
JsonSaveStr(root, "file.default.dumppath", session.defaultPaths[spDump]); // JsonSaveStr(root, "file.default.dumppath", session.defaultPaths[spDump]);
JsonSaveStr(root, "file.default.tracepath", session.defaultPaths[spTrace]); // JsonSaveStr(root, "file.default.tracepath", session.defaultPaths[spTrace]);
// Plot window // Plot window
JsonSaveInt(root, "window.plot.xpos", session.plot.x); JsonSaveInt(root, "window.plot.xpos", session.plot.x);
@ -240,7 +240,7 @@ void preferences_load_callback(json_t *root) {
if (strncmp(tempStr, "simple", 6) == 0) session.client_debug_level = cdbSIMPLE; if (strncmp(tempStr, "simple", 6) == 0) session.client_debug_level = cdbSIMPLE;
if (strncmp(tempStr, "full", 4) == 0) session.client_debug_level = cdbFULL; if (strncmp(tempStr, "full", 4) == 0) session.client_debug_level = cdbFULL;
} }
/*
// default save path // default save path
if (json_unpack_ex(root, &up_error, 0, "{s:s}", "file.default.savepath", &s1) == 0) if (json_unpack_ex(root, &up_error, 0, "{s:s}", "file.default.savepath", &s1) == 0)
setDefaultPath (spDefault,s1); setDefaultPath (spDefault,s1);
@ -252,7 +252,7 @@ void preferences_load_callback(json_t *root) {
// default trace path // default trace path
if (json_unpack_ex(root, &up_error, 0, "{s:s}", "file.default.tracepath", &s1) == 0) if (json_unpack_ex(root, &up_error, 0, "{s:s}", "file.default.tracepath", &s1) == 0)
setDefaultPath (spTrace,s1); setDefaultPath (spTrace,s1);
*/
// window plot // window plot
if (json_unpack_ex(root, &up_error, 0, "{s:i}", "window.plot.xpos", &i1) == 0) if (json_unpack_ex(root, &up_error, 0, "{s:i}", "window.plot.xpos", &i1) == 0)
session.plot.x = i1; session.plot.x = i1;
@ -359,7 +359,7 @@ static int usage_set_hints() {
return PM3_SUCCESS; return PM3_SUCCESS;
} }
/*
static int usage_set_savePaths() { static int usage_set_savePaths() {
PrintAndLogEx(NORMAL, "Usage: pref set savepaths [help] [create] [default <path>] [dump <path>] [trace <path>]"); PrintAndLogEx(NORMAL, "Usage: pref set savepaths [help] [create] [default <path>] [dump <path>] [trace <path>]");
PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, "Options:");
@ -371,7 +371,7 @@ static int usage_set_savePaths() {
return PM3_SUCCESS; return PM3_SUCCESS;
} }
*/
// Preference Processing Functions // Preference Processing Functions
// typedef enum preferenceId {prefNONE,prefHELP,prefEMOJI,prefCOLOR,prefPLOT,prefOVERLAY,prefHINTS,prefCLIENTDEBUG} preferenceId_t; // typedef enum preferenceId {prefNONE,prefHELP,prefEMOJI,prefCOLOR,prefPLOT,prefOVERLAY,prefHINTS,prefCLIENTDEBUG} preferenceId_t;
typedef enum prefShowOpt {prefShowNone, prefShowOLD, prefShowNEW} prefShowOpt_t; typedef enum prefShowOpt {prefShowNone, prefShowOLD, prefShowNEW} prefShowOpt_t;
@ -457,6 +457,7 @@ void showDeviceDebugState(prefShowOpt_t Opt) {
} }
} }
*/ */
/*
void showSavePathState(savePaths_t pathIndex, prefShowOpt_t Opt) { void showSavePathState(savePaths_t pathIndex, prefShowOpt_t Opt) {
char tempStr[50]; char tempStr[50];
@ -479,7 +480,7 @@ void showSavePathState(savePaths_t pathIndex, prefShowOpt_t Opt) {
else else
PrintAndLogEx(NORMAL, " %s %s "_GREEN_("%s"), prefShowMsg(Opt), tempStr, session.defaultPaths[pathIndex]); PrintAndLogEx(NORMAL, " %s %s "_GREEN_("%s"), prefShowMsg(Opt), tempStr, session.defaultPaths[pathIndex]);
} }
*/
void showPlotPosState(void){ void showPlotPosState(void){
PrintAndLogEx(NORMAL, " Plot window............ X "_GREEN_("%4d")" Y "_GREEN_("%4d")" H "_GREEN_("%4d")" W "_GREEN_("%4d"), PrintAndLogEx(NORMAL, " Plot window............ X "_GREEN_("%4d")" Y "_GREEN_("%4d")" H "_GREEN_("%4d")" W "_GREEN_("%4d"),
session.plot.x, session.plot.y, session.plot.h, session.plot.w); session.plot.x, session.plot.y, session.plot.h, session.plot.w);
@ -760,7 +761,7 @@ static int setCmdHint (const char *Cmd)
return PM3_SUCCESS; return PM3_SUCCESS;
} }
/*
static int setCmdSavePaths (const char *Cmd) { static int setCmdSavePaths (const char *Cmd) {
uint8_t cmdp = 0; uint8_t cmdp = 0;
bool errors = false; bool errors = false;
@ -845,13 +846,13 @@ static int setCmdSavePaths (const char *Cmd) {
return PM3_SUCCESS; return PM3_SUCCESS;
} }
*/
static command_t setCommandTable[] = { static command_t setCommandTable[] = {
{"help", setCmdHelp, AlwaysAvailable, "This help"}, {"help", setCmdHelp, AlwaysAvailable, "This help"},
{"emoji", setCmdEmoji, AlwaysAvailable, "Set emoji display"}, {"emoji", setCmdEmoji, AlwaysAvailable, "Set emoji display"},
{"hints", setCmdHint, AlwaysAvailable, "Set hint display"}, {"hints", setCmdHint, AlwaysAvailable, "Set hint display"},
{"color", setCmdColor, AlwaysAvailable, "Set color support"}, {"color", setCmdColor, AlwaysAvailable, "Set color support"},
{"defaultsavepaths", setCmdSavePaths, AlwaysAvailable, "... to be adjusted next ... "}, // {"defaultsavepaths", setCmdSavePaths, AlwaysAvailable, "... to be adjusted next ... "},
{"clientdebug", setCmdDebug, AlwaysAvailable, "Set client debug level"}, {"clientdebug", setCmdDebug, AlwaysAvailable, "Set client debug level"},
// {"devicedebug", setCmdDeviceDebug, AlwaysAvailable, "Set device debug level"}, // {"devicedebug", setCmdDeviceDebug, AlwaysAvailable, "Set device debug level"},
{NULL, NULL, NULL, NULL} {NULL, NULL, NULL, NULL}

View file

@ -21,7 +21,7 @@ typedef enum logLevel {NORMAL, SUCCESS, INFO, FAILED, WARNING, ERR, DEBUG, INPLA
typedef enum emojiMode {ALIAS, EMOJI, ALTTEXT, ERASE} emojiMode_t; typedef enum emojiMode {ALIAS, EMOJI, ALTTEXT, ERASE} emojiMode_t;
typedef enum clientdebugLevel {cdbOFF, cdbSIMPLE, cdbFULL} clientdebugLevel_t; typedef enum clientdebugLevel {cdbOFF, cdbSIMPLE, cdbFULL} clientdebugLevel_t;
// typedef enum devicedebugLevel {ddbOFF, ddbERROR, ddbINFO, ddbDEBUG, ddbEXTENDED} devicedebugLevel_t; // typedef enum devicedebugLevel {ddbOFF, ddbERROR, ddbINFO, ddbDEBUG, ddbEXTENDED} devicedebugLevel_t;
typedef enum savePaths {spDefault, spDump, spTrace, spItemCount} savePaths_t; // last item spItemCount used to auto map to number of files //typedef enum savePaths {spDefault, spDump, spTrace, spItemCount} savePaths_t; // last item spItemCount used to auto map to number of files
typedef struct {int x; int y; int h; int w;} qtWindow_t; typedef struct {int x; int y; int h; int w;} qtWindow_t;
typedef struct { typedef struct {
@ -36,7 +36,7 @@ typedef struct {
bool window_changed; // track if plot/overlay pos/size changed to save on exit bool window_changed; // track if plot/overlay pos/size changed to save on exit
qtWindow_t plot; qtWindow_t plot;
qtWindow_t overlay; qtWindow_t overlay;
char *defaultPaths[spItemCount]; // Array should allow loop searching for files // char *defaultPaths[spItemCount]; // Array should allow loop searching for files
clientdebugLevel_t client_debug_level; clientdebugLevel_t client_debug_level;
// uint8_t device_debug_level; // uint8_t device_debug_level;
} session_arg_t; } session_arg_t;