X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/20f9a2a1d54952ed15066c93490f0e8fb0d43b67..62a95012e9168c70f190407edc2c611363c7122a:/client/util.h diff --git a/client/util.h b/client/util.h index 8b65bc65..ce8876ed 100644 --- a/client/util.h +++ b/client/util.h @@ -10,6 +10,38 @@ #include #include +#include +#include +#include +#include +#include + +#ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +int ukbhit(void); + +void AddLogLine(char *fileName, char *extData, char *c); +void AddLogHex(char *fileName, char *extData, const uint8_t * data, const size_t len); +void AddLogUint64(char *fileName, char *extData, const uint64_t data); +void AddLogCurrentDT(char *fileName); +void FillFileNameByUID(char *fileName, uint8_t * uid, char *ext, int byteCount); void print_hex(const uint8_t * data, const size_t len); char * sprint_hex(const uint8_t * data, const size_t len); + +void num_to_bytes(uint64_t n, size_t len, uint8_t* dest); +uint64_t bytes_to_num(uint8_t* src, size_t len); + +char param_getchar(const char *line, int paramnum); +uint8_t param_get8(const char *line, int paramnum); +uint8_t param_get8ex(const char *line, int paramnum, int deflt, int base); +uint32_t param_get32ex(const char *line, int paramnum, int deflt, int base); +uint64_t param_get64ex(const char *line, int paramnum, int deflt, int base); +int param_gethex(const char *line, int paramnum, uint8_t * data, int hexcnt); +int param_getstr(const char *line, int paramnum, char * str); +