69,371
社区成员
发帖
与我相关
我的任务
分享
#define gopt_start(...) (const void*)( const struct { int k; int f; const char *s; const char*const*l; }[]){ __VA_ARGS__, {0}}
#define gopt_option(k,f,s,l) { k, f, s, l }
#define gopt_start(...) (const void*)( const struct { int k; int f; const char *s; const char*const*l; }[]){ __VA_ARGS__, {0}}
#define gopt_option(k,f,s,l) { k, f, s, l }
#define gopt_shorts( ... ) (const char*)(const char[]){ __VA_ARGS__, 0 }
#define gopt_longs( ... ) (const char**)(const char*[]){ __VA_ARGS__, NULL }
void *options= gopt_sort( & argc, argv, gopt_start(
gopt_option('h', 0, gopt_shorts('h', '?'), gopt_longs("help", "HELP")),
gopt_option('v', 0, gopt_shorts('v'), gopt_longs("version")),
gopt_option('s', GOPT_ARG, gopt_shorts('s'), gopt_longs("secu_flag")),
gopt_option('c', GOPT_ARG, gopt_shorts('c'), gopt_longs("cid")),
gopt_option('S', 0, gopt_shorts('S'), gopt_longs("sim_unlock")),
gopt_option('f', 0, gopt_shorts('f'), gopt_longs("free_all")),
gopt_option('w', GOPT_ARG, gopt_shorts('w'), gopt_longs("disable_wp")),
gopt_option('k', GOPT_ARG, gopt_shorts('k'), gopt_longs("disable_kf")),
gopt_option('b', GOPT_ARG, gopt_shorts('b'), gopt_longs("hboot")),
gopt_option('r', GOPT_ARG, gopt_shorts('r'), gopt_longs("restore")),
gopt_option('y', GOPT_ARG, gopt_shorts('y'), gopt_longs("recovery")),
gopt_option('d', 0, gopt_shorts('d'), gopt_longs("debug"))));