mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-03 22:53:58 +08:00
add some defines to get double
This commit is contained in:
parent
12b3a7c236
commit
dc9e16a4e1
1 changed files with 6 additions and 0 deletions
|
@ -19,9 +19,15 @@
|
|||
|
||||
#define arg_getsize(a) (sizeof(a) / sizeof(a[0]))
|
||||
#define arg_get_lit(ctx, n) (((struct arg_lit*)((ctx)->argtable)[n])->count)
|
||||
|
||||
#define arg_get_int_count(ctx, n)(((struct arg_int*)((ctx)->argtable)[n])->count)
|
||||
#define arg_get_int(ctx, n) (((struct arg_int*)((ctx)->argtable)[n])->ival[0])
|
||||
#define arg_get_int_def(ctx, n, def)(arg_get_int_count((ctx), n) ? (arg_get_int((ctx), n)) : (def))
|
||||
|
||||
#define arg_get_dbl_count(ctx, n)(((struct arg_dbl*)((ctx)->argtable)[n])->count)
|
||||
#define arg_get_dbl(ctx, n) (((struct arg_dbl*)((ctx)->argtable)[n])->dval[0])
|
||||
#define arg_get_dbl_def(ctx, n, def)(arg_get_dbl_count((ctx), n) ? (arg_get_dbl((ctx), n)) : (def))
|
||||
|
||||
#define arg_get_str(ctx, n) ((struct arg_str*)((ctx)->argtable)[n])
|
||||
#define arg_get_str_len(ctx, n) (strlen(((struct arg_str*)((ctx)->argtable)[n])->sval[0]))
|
||||
|
||||
|
|
Loading…
Reference in a new issue