mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 02:34:48 +08:00
Chg: fixes from original repo
This commit is contained in:
parent
76fa7efe72
commit
1d6ef96d12
2 changed files with 23 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
/*******************************************************************************
|
||||
* argtable3: Declares the main interfaces of the library
|
||||
*
|
||||
* This file is part of the argtable3 library.
|
||||
*
|
||||
* Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
|
||||
|
@ -39,6 +41,13 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#define ARG_REX_ICASE 1
|
||||
#define ARG_DSTR_SIZE 200
|
||||
#define ARG_CMD_NAME_LEN 100
|
||||
#define ARG_CMD_DESCRIPTION_LEN 256
|
||||
|
||||
#ifndef ARG_REPLACE_GETOPT
|
||||
#define ARG_REPLACE_GETOPT 1 /* use the embedded getopt as the system getopt(3) */
|
||||
#endif /* ARG_REPLACE_GETOPT */
|
||||
|
||||
/* bit masks for arg_hdr.flag */
|
||||
enum {
|
||||
|
@ -143,6 +152,13 @@ struct arg_end {
|
|||
const char **argval; /* Array of pointers to offending argv[] string */
|
||||
};
|
||||
|
||||
/*
|
||||
typedef struct arg_cmd_info {
|
||||
char name[ARG_CMD_NAME_LEN];
|
||||
char description[ARG_CMD_DESCRIPTION_LEN];
|
||||
arg_cmdfn* proc;
|
||||
} arg_cmd_info_t;
|
||||
*/
|
||||
|
||||
/**** arg_xxx constructor functions *********************************/
|
||||
|
||||
|
|
|
@ -13,16 +13,16 @@
|
|||
#include "argtable3.h"
|
||||
#include "util.h"
|
||||
|
||||
#define arg_param_begin arg_lit0("hH", "help", "print this help and exit")
|
||||
#define arg_param_begin arg_lit0("hH", "help", "This help")
|
||||
#define arg_param_end arg_end(20)
|
||||
|
||||
#define arg_getsize(a) (sizeof(a) / sizeof(a[0]))
|
||||
#define arg_get_lit(n)(((struct arg_lit*)argtable[n])->count)
|
||||
#define arg_getsize(a) (sizeof(a) / sizeof(a[0]))
|
||||
#define arg_get_lit(n) (((struct arg_lit*)argtable[n])->count)
|
||||
#define arg_get_int_count(n)(((struct arg_int*)argtable[n])->count)
|
||||
#define arg_get_int(n)(((struct arg_int*)argtable[n])->ival[0])
|
||||
#define arg_get_int_def(n,def)(arg_get_int_count(n)?(arg_get_int(n)):(def))
|
||||
#define arg_get_str(n)((struct arg_str*)argtable[n])
|
||||
#define arg_get_str_len(n)(strlen(((struct arg_str*)argtable[n])->sval[0]))
|
||||
#define arg_get_int(n) (((struct arg_int*)argtable[n])->ival[0])
|
||||
#define arg_get_int_def(n, def)(arg_get_int_count(n) ? (arg_get_int(n)) : (def))
|
||||
#define arg_get_str(n) ((struct arg_str*)argtable[n])
|
||||
#define arg_get_str_len(n) (strlen(((struct arg_str*)argtable[n])->sval[0]))
|
||||
|
||||
#define arg_strx1(shortopts, longopts, datatype, glossary) (arg_strn((shortopts), (longopts), (datatype), 1, 250, (glossary)))
|
||||
#define arg_strx0(shortopts, longopts, datatype, glossary) (arg_strn((shortopts), (longopts), (datatype), 0, 250, (glossary)))
|
||||
|
|
Loading…
Reference in a new issue