summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c
index 33427ce..491b4f0 100644
--- a/src/options.c
+++ b/src/options.c
@@ -194,11 +194,19 @@ int options_parse(options_t* opt, int argc, char* argv[])
PARSE_STRING_PARAM("-P","--write-pid", opt->pid_file_)
PARSE_STRING_LIST("-L","--log", opt->log_targets_)
PARSE_BOOL_PARAM("-U", "--debug", opt->debug_)
+ PARSE_INT_PARAM("-a","--adapter", opt->adapter_, 10)
+ PARSE_INT_PARAM("-F","--frontend", opt->frontend_, 10)
+ PARSE_INT_PARAM("-f","--frequency", opt->frequency_, 10)
+ PARSE_STRING_PARAM("-o","--polarity", opt->polarity_)
+ PARSE_STRING_PARAM("-i","--pids", opt->pids_)
+ PARSE_STRING_PARAM("-H","--host", opt->host_)
+ PARSE_STRING_PARAM("-p","--port", opt->port_)
+
else
return i;
}
- if(opt->interval_ <= 0)
+ if(opt->frequency_ < 0 || opt->adapter_ < 0 || opt->frontend_ < 0)
return -4;
if(opt->debug_) {
@@ -234,6 +242,13 @@ void options_default(options_t* opt)
opt->pid_file_ = NULL;
string_list_init(&opt->log_targets_);
opt->debug_ = 0;
+ opt->adapter_ = 0;
+ opt->frontend_ = 0;
+ opt->frequency_ = 514000000;
+ opt->polarity_ = strdup("H");
+ opt->pids_ = strdup("5010:5011");
+ opt->host_ = NULL;
+ opt->port_ = strdup("80");
}
void options_clear(options_t* opt)
@@ -252,6 +267,14 @@ void options_clear(options_t* opt)
if(opt->pid_file_)
free(opt->pid_file_);
string_list_clear(&opt->log_targets_);
+ if(opt->polarity_)
+ free(opt->polarity_);
+ if(opt->pids_)
+ free(opt->pids_);
+ if(opt->host_)
+ free(opt->host_);
+ if(opt->port_)
+ free(opt->port_);
}
void options_print_usage()
@@ -267,6 +290,13 @@ void options_print_usage()
printf(" [-L|--log] <target>:<level>[,<param1>[,<param2>..]]\n");
printf(" add a log target, can be invoked several times\n");
printf(" [-U|--debug] don't daemonize and log to stdout with maximum log level\n");
+ printf(" [-a|--adapter] <num> the dvb adapter to use (default 0)\n");
+ printf(" [-F|--frontend] <num> the dvb adapter to use (default 0)\n");
+ printf(" [-f|--frequency <hertz> the frequency to tune to (default 514000000)\n");
+ printf(" [-o|--polarity (H,V) polarity of the signal (default H)\n");
+ printf(" [-i|--pids <pid:pid> the pids of the stream (default 5010:5011)\n");
+ printf(" [-H|--host <addr> the local interface to bind to (default any interface)\n");
+ printf(" [-p|--port <port> the port to listen to (default 80)\n");
}
void options_print_version()
@@ -289,4 +319,11 @@ void options_print(options_t* opt)
printf("log_targets: \n");
string_list_print(&opt->log_targets_, " '", "'\n");
printf("debug: %s\n", !opt->debug_ ? "false" : "true");
+ printf("adapter: %d\n", opt->adapter_);
+ printf("frontend: %d\n", opt->frontend_);
+ printf("frequency: %d\n", opt->frequency_);
+ printf("polarity: '%s'\n", opt->polarity_);
+ printf("pids: '%s'\n", opt->pids_);
+ printf("host: '%s'\n", opt->host_);
+ printf("port: '%s'\n", opt->port_);
}