#include <getopt.h>
#include <stdio.h>
#include <string.h>
static int
{
int r;
};
return r;
}
static void
{
static const struct option opts[] = {
{ "port", required_argument, NULL, 'p' },
{ "certificate", required_argument, NULL, 'c' },
{ "key", required_argument, NULL, 'k' },
{ "data", required_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ 0, 0, 0, 0 }
};
while ((c = getopt_long(argc, argv, "p:c:k:d:h", opts,
&opt_idx)) != -1) {
switch (c) {
case 'p':
port = atoi(optarg);
break;
case 'c':
goto err;
break;
case 'k':
goto err;
break;
case 'd':
break;
case 'h':
default:
fprintf(stderr,
"Usage:\n\t%s [-p <port >]\n"
"\t [-c <certificate to use>]\n"
"\t [-k <certificate key>]\n"
"\t [-d <data to serve>]\n",
argv[0]);
return;
}
}
fprintf(stderr, "ERROR: No data was given. Run with -h or --help for help\n");
goto err;
}
.security = {
}
});
fprintf(stderr, "ERROR: Failed to create the server\n");
goto err;
}
fprintf(stderr, "ERROR: Failed to register the handler\n");
goto err;
}
return;
err:
}
static void
{
}