1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
31 #define _USE_MATH_DEFINES
33 typedef enum {STYLE_BAR
, STYLE_MIXED
, STYLE_VALUE
} barMode_t
;
34 typedef enum logLevel
{NORMAL
, SUCCESS
, INFO
, FAILED
, WARNING
, ERR
, DEBUG
, INPLACE
, HINT
} logLevel_t
;
35 typedef enum emojiMode
{EMO_ALIAS
, EMO_EMOJI
, EMO_ALTTEXT
, EMO_NONE
} emojiMode_t
;
36 typedef enum clientdebugLevel
{cdbOFF
, cdbSIMPLE
, cdbFULL
} clientdebugLevel_t
;
37 // typedef enum devicedebugLevel {ddbOFF, ddbERROR, ddbINFO, ddbDEBUG, ddbEXTENDED} devicedebugLevel_t;
39 // last item spItemCount used to auto map to number of files
40 typedef enum savePaths
{spDefault
, spDump
, spTrace
, spItemCount
} savePaths_t
;
41 typedef struct {int x
; int y
; int h
; int w
;} qtWindow_t
;
44 bool preferences_loaded
;
48 emojiMode_t emoji_mode
;
53 bool window_changed
; // track if plot/overlay pos/size changed to save on exit
58 char *defaultPaths
[spItemCount
]; // Array should allow loop searching for files
59 clientdebugLevel_t client_debug_level
;
61 // uint8_t device_debug_level;
62 uint16_t client_exe_delay
;
64 pm3_device_t
*current_device
;
68 extern session_arg_t g_session
;
71 #define M_PI 3.14159265358979323846264338327
73 #define MAX_PRINT_BUFFER 2048
75 #define PROMPT_CLEARLINE PrintAndLogEx(INPLACE, " \r")
76 void PrintAndLogOptions(const char *str
[][2], size_t size
, size_t space
);
77 void PrintAndLogEx(logLevel_t level
, const char *fmt
, ...);
78 void SetFlushAfterWrite(bool value
);
79 bool GetFlushAfterWrite(void);
80 void memcpy_filter_ansi(void *dest
, const void *src
, size_t n
, bool filter
);
81 void memcpy_filter_rlmarkers(void *dest
, const void *src
, size_t n
);
82 void memcpy_filter_emoji(void *dest
, const void *src
, size_t n
, emojiMode_t mode
);
83 void free_grabber(void);
85 int searchHomeFilePath(char **foundpath
, const char *subdir
, const char *filename
, bool create_home
);
87 extern pthread_mutex_t g_print_lock
;
89 void print_progress(uint64_t count
, uint64_t max
, barMode_t style
);
91 void iceIIR_Butterworth(int *data
, const size_t len
);
92 void iceSimple_Filter(int *data
, const size_t len
, uint8_t k
);