linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gregor Jasny <gjasny@googlemail.com>
To: Konke Radlow <kradlow@cisco.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] Initial version of RDS Control utility Signed-off-by: Konke Radlow <kradlow@cisco.com>
Date: Thu, 26 Jul 2012 21:02:02 +0200	[thread overview]
Message-ID: <5011942A.9020300@googlemail.com> (raw)
In-Reply-To: <89e7f656fc45f12f2cb5369738b3afd1f712674f.1343237398.git.kradlow@cisco.com>

On 7/25/12 7:44 PM, Konke Radlow wrote:
> --- /dev/null
> +++ b/utils/rds-ctl/rds-ctl.cpp
> @@ -0,0 +1,978 @@
> +/*
> + * rds-ctl.cpp is based on v4l2-ctl.cpp
> + * 
> + * the following applies for all RDS related parts:
> + * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
> + * Author: Konke Radlow <koradlow@gmail.com>
> + * 
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published by
> + * the Free Software Foundation; either version 2.1 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
> + */
> +
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <wchar.h>
> +#include <locale.h>
> +#include <inttypes.h>
> +#include <getopt.h>
> +#include <sys/types.h>
> +#include <fcntl.h>
> +#include <errno.h>
> +#include <sys/ioctl.h>
> +#include <sys/time.h>
> +#include <dirent.h>
> +#include <config.h>
> +#include <signal.h>
> +
> +#ifdef HAVE_SYS_KLOG_H
> +#include <sys/klog.h>
> +#endif

You don't call klog, so you can drop these three lines

> +static int parse_cl(int argc, char **argv)
> +{
> +	int i = 0;
> +	int idx = 0;
> +	int opt = 0;
> +	char short_options[26 * 2 * 2 + 1];
> +
> +	if (argc == 1) {
> +		usage_hint();
> +		exit(1);
> +	}
> +	for (i = 0; long_options[i].name; i++) {
> +		if (!isalpha(long_options[i].val))
> +			continue;
> +		short_options[idx++] = long_options[i].val;
> +		if (long_options[i].has_arg == required_argument)
> +			short_options[idx++] = ':';
> +	}
> +	while (1) {
> +		// TODO: remove option_index ?
> +		int option_index = 0;
> +
> +		short_options[idx] = 0;
> +		opt = getopt_long(argc, argv, short_options,
> +				 long_options, &option_index);
> +		if (opt == -1)
> +			break;
> +
> +		params.options[(int)opt] = 1;
> +		switch (opt) {
> +		case OptSetDevice:
> +			strncpy(params.fd_name, optarg, 80);
> +			if (optarg[0] >= '0' && optarg[0] <= '9' && optarg[1] == 0) {

see isdigit from <types.h> (or std::isdigit from <ctypes>)


Thanks,
Gregor

  reply	other threads:[~2012-07-26 19:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 17:43 [RFC PATCH 0/2] Add support for RDS decoding Konke Radlow
2012-07-25 17:44 ` [RFC PATCH 1/2] Initial version of the RDS-decoder library Signed-off-by: Konke Radlow <kradlow@cisco.com> Konke Radlow
2012-07-25 17:44   ` [RFC PATCH 2/2] Initial version of RDS Control utility " Konke Radlow
2012-07-26 19:02     ` Gregor Jasny [this message]
2012-07-26 19:13     ` Gregor Jasny
2012-07-26 19:46       ` Konke Radlow
2012-07-27  6:50       ` Hans Verkuil
2012-07-28 11:11     ` Hans de Goede
2012-07-30  6:50       ` Hans Verkuil
2012-07-26 14:28   ` [RFC PATCH 1/2] Initial version of the RDS-decoder library " Ezequiel Garcia
2012-07-26 14:39     ` Hans Verkuil
2012-07-26 14:41       ` Ezequiel Garcia
2012-07-26 18:46   ` Gregor Jasny
2012-07-26 18:49   ` Gregor Jasny
2012-07-26 18:41 ` [RFC PATCH 0/2] Add support for RDS decoding Gregor Jasny
2012-07-27 14:27   ` Konke Radlow
2012-07-29 17:07     ` Gregor Jasny
2012-07-30  9:36       ` Konke Radlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5011942A.9020300@googlemail.com \
    --to=gjasny@googlemail.com \
    --cc=kradlow@cisco.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).