/*
* Copyright (C) 2012 - 2015 Nominum, Inc.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice and this permission notice
* appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <isc/parseint.h>
#include "log.h"
#include "opt.h"
#include "util.h"
typedef struct {
char c;
const char *desc;
const char *help;
const char *defval;
union {
void *valp;
char **stringp;
unsigned int *uintp;
double *doublep;
} u;
} opt_t;
static unsigned int nopts;
static const char *progname;
void
{
char s[3];
perf_log_fatal("too many defined options");
opt->c = c;
} else {
}
}
void
perf_opt_usage(void)
{
for (i = 0; i < nopts; i++) {
arg_len = 6;
for (j = 0; j < prefix_len; j++)
}
}
for (i = 0; i < nopts; i++) {
}
}
static isc_uint32_t
{
val = 0;
exit(1);
}
return val;
}
static isc_uint64_t
{
const char *s;
char c;
s = str;
while (*s != 0) {
c = *s++;
if (c == '.') {
if (seen_dot)
goto fail;
} else if (c < '0' || c > '9') {
goto fail;
}
}
fail:
exit(1);
}
static double
char c;
int index = 0;
if (c == '.') {
if (seen_dot)
goto fail;
} else if (c < '0' || c > '9') {
goto fail;
}
index++;
}
fail:
exit(1);
}
void
{
int c;
unsigned int i;
for (i = 0; i < nopts; i++) {
if (opts[i].c == c)
break;
}
if (i == nopts) {
exit(1);
}
if (c == 'h') {
exit(0);
}
case perf_opt_string:
break;
case perf_opt_boolean:
break;
case perf_opt_uint:
1, 0xFFFFFFFF);
break;
case perf_opt_timeval:
break;
case perf_opt_double:
break;
case perf_opt_port:
0, 0xFFFF);
break;
}
}
exit(1);
}
}