static const struct option longopts[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
- { 0 },
+ { GETOPT_NULL_LONGOPT },
};
static const char *const shortopts = "+hv";
static const struct option longopts[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
- { 0 },
+ { GETOPT_NULL_LONGOPT },
};
static const char *const shortopts = "+hv";
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
{ "active-low", no_argument, NULL, 'l' },
- { 0 },
+ { GETOPT_NULL_LONGOPT },
};
static const char *const shortopts = "+hvl";
static const struct option longopts[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
- { 0 },
+ { GETOPT_NULL_LONGOPT },
};
static const char *const shortopts = "+hv";
{ "rising-edge", no_argument, NULL, 'r' },
{ "falling-edge", no_argument, NULL, 'f' },
{ "format", required_argument, NULL, 'F' },
- { 0 },
+ { GETOPT_NULL_LONGOPT },
};
static const char *const shortopts = "+hvln:srfF:";
{ "sec", required_argument, NULL, 's' },
{ "usec", required_argument, NULL, 'u' },
{ "background", no_argument, NULL, 'b' },
- { 0 },
+ { GETOPT_NULL_LONGOPT },
};
static const char *const shortopts = "+hvlm:s:u:b";
#define PRINTF(fmt, arg) __attribute__((format(printf, fmt, arg)))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
+#define GETOPT_NULL_LONGOPT NULL, 0, NULL, 0
+
const char * get_progname(void);
void die(const char *fmt, ...);
void die_perror(const char *fmt, ...);