From: Andre Date: Mon, 27 Mar 2006 04:28:56 +0000 (+0200) Subject: update to gengetopt-2.17 X-Git-Tag: v0.2.12~126 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=f4fb0289834e76a23839719ab0e89fe29b591d3f;p=paraslash.git update to gengetopt-2.17 gengetopt-2.17 has an improved help management, thanks again to Lorenzo Bettini for implementing my suggestions. The help texts of the options are contained in an array which is defined in xyz.cmdline.c and declared as extern in xyz.cmdline.h. In order to link more than one xyz.cmdline.o into a single binary, these arrays must have different names. So use the --arg-struct-name option of gengetopt for each receiver/filter. --- diff --git a/Makefile.in b/Makefile.in index ee550de4..42ab70ec 100644 --- a/Makefile.in +++ b/Makefile.in @@ -129,11 +129,13 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo %_recv.cmdline.h %_recv.cmdline.c: %_recv.ggo gengetopt $(module_ggo_opts) \ + --arg-struct-name=$(subst .ggo,,$<)_args_info \ --file-name=$(subst .ggo,,$<).cmdline \ --func-name $(subst .ggo,,$<)_cmdline_parser < $< %_filter.cmdline.h %_filter.cmdline.c: %_filter.ggo gengetopt $(module_ggo_opts) \ + --arg-struct-name=$(subst .ggo,,$<)_args_info \ --file-name=$(subst .ggo,,$<).cmdline \ --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $< diff --git a/NEWS b/NEWS index ec27bc67..b1e73d4a 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ NEWS o update to libortp-0.9.1 + o update to gengetopt-2.17 + 0.2.11 (2006-03-11) "atomic duality" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compress.c b/compress.c index b7ddc285..de5448fb 100644 --- a/compress.c +++ b/compress.c @@ -36,7 +36,7 @@ struct private_compress_data { /** the current multiplier */ unsigned current_gain; /** points to the configuration data for this instance of the compress filter */ - struct gengetopt_args_info *conf; + struct compress_filter_args_info *conf; /** minimal admissible gain */ unsigned min_gain; /** maximal admissible gain */ @@ -111,7 +111,7 @@ static void close_compress(struct filter_node *fn) static void *compress_parse_config(int argc, char **argv) { - struct gengetopt_args_info *ret = para_calloc(sizeof(struct gengetopt_args_info)); + struct compress_filter_args_info *ret = para_calloc(sizeof(struct compress_filter_args_info)); if (!compress_cmdline_parser(argc, argv, ret)) return ret; free(ret); diff --git a/dccp_recv.c b/dccp_recv.c index 1ef1a31d..679eb227 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -68,7 +68,7 @@ static void dccp_recv_close(struct receiver_node *rn) static int dccp_recv_open(struct receiver_node *rn) { struct private_dccp_recv_data *pdd; - struct gengetopt_args_info *conf = rn->conf; + struct dccp_recv_args_info *conf = rn->conf; int ret; struct addrinfo *ai; char *tmp; @@ -108,7 +108,7 @@ static void dccp_shutdown(void) static void *dccp_recv_parse_config(int argc, char **argv) { - struct gengetopt_args_info *tmp = para_calloc(sizeof(struct gengetopt_args_info)); + struct dccp_recv_args_info *tmp = para_calloc(sizeof(struct dccp_recv_args_info)); if (!dccp_recv_cmdline_parser(argc, argv, tmp)) return tmp; diff --git a/http_recv.c b/http_recv.c index 2e1d467b..da28faaa 100644 --- a/http_recv.c +++ b/http_recv.c @@ -156,7 +156,7 @@ static void http_recv_close(struct receiver_node *rn) static void *http_recv_parse_config(int argc, char **argv) { - struct gengetopt_args_info *tmp = para_calloc(sizeof(struct gengetopt_args_info)); + struct http_recv_args_info *tmp = para_calloc(sizeof(struct http_recv_args_info)); if (!http_recv_cmdline_parser(argc, argv, tmp)) return tmp; @@ -168,7 +168,7 @@ static int http_recv_open(struct receiver_node *rn) { struct private_http_recv_data *phd; struct hostent *he; - struct gengetopt_args_info *conf = rn->conf; + struct http_recv_args_info *conf = rn->conf; struct sockaddr_in their_addr; int ret; diff --git a/oggdec.c b/oggdec.c index d6c8f112..714d620e 100644 --- a/oggdec.c +++ b/oggdec.c @@ -98,7 +98,7 @@ static void ogg_open(struct filter_node *fn) { struct private_oggdec_data *pod = para_calloc( sizeof(struct private_oggdec_data)); - struct gengetopt_args_info *conf = fn->conf; + struct oggdec_filter_args_info *conf = fn->conf; fn->private_data = pod; fn->bufsize = conf->bufsize_arg * 1024; @@ -125,7 +125,7 @@ static ssize_t ogg_convert(char *inbuffer, size_t len, struct filter_node *fn) { ssize_t ret; struct private_oggdec_data *pod = fn->private_data; - struct gengetopt_args_info *conf = fn->conf; + struct oggdec_filter_args_info *conf = fn->conf; /* make the buffer known to the read callback cb_read() */ pod->inbuf = inbuffer; pod->inbuf_len = len; @@ -174,7 +174,7 @@ again: static void *oggdec_parse_config(int argc, char **argv) { - struct gengetopt_args_info *ret = para_calloc(sizeof(struct gengetopt_args_info)); + struct oggdec_filter_args_info *ret = para_calloc(sizeof(struct oggdec_filter_args_info)); if (!oggdec_cmdline_parser(argc, argv, ret)) return ret; free(ret); diff --git a/ortp_recv.c b/ortp_recv.c index 4df8e3a5..1e440420 100644 --- a/ortp_recv.c +++ b/ortp_recv.c @@ -234,7 +234,7 @@ static void *ortp_recv_parse_config(int argc, char **argv) { int ret; - struct gengetopt_args_info *tmp = para_calloc(sizeof(struct gengetopt_args_info)); + struct ortp_recv_args_info *tmp = para_calloc(sizeof(struct ortp_recv_args_info)); ret = ortp_recv_cmdline_parser(argc, argv, tmp)? -E_ORTP_SYNTAX : 1; if (ret > 0) @@ -246,7 +246,7 @@ static void *ortp_recv_parse_config(int argc, char **argv) static int ortp_recv_open(struct receiver_node *rn) { struct private_ortp_recv_data *pord; - struct gengetopt_args_info *conf = rn->conf; + struct ortp_recv_args_info *conf = rn->conf; rn->buf = para_calloc(CHUNK_SIZE);