From d08c4770abbd13ad8f474adc709adb20996662d5 Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Tue, 29 May 2012 01:47:44 +0200 Subject: add local copy of getopt() for win32 build Now all commandline utilities have a platform-independent syntax. Signed-off-by: Steve Markgraf --- src/rtl_test.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/rtl_test.c') diff --git a/src/rtl_test.c b/src/rtl_test.c index 455c444..fffe089 100644 --- a/src/rtl_test.c +++ b/src/rtl_test.c @@ -26,6 +26,7 @@ #include #else #include +#include "getopt/getopt.h" #endif #include "rtl-sdr.h" @@ -43,11 +44,6 @@ static rtlsdr_dev_t *dev = NULL; void usage(void) { - #ifdef _WIN32 - fprintf(stderr,"rtl_test, a benchmark tool for RTL2832 based DVB-T receivers\n\n" - "Usage:\t rtl_test.exe [device_index] [samplerate in kHz] [e4k test mode]\n" - "\ti.e. rtl_test.exe 0 2048 1\n"); - #else fprintf(stderr, "rtl_test, a benchmark tool for RTL2832 based DVB-T receivers\n\n" "Usage:\n" @@ -56,7 +52,6 @@ void usage(void) "\t[-t enable Elonics E4000 tuner benchmark]\n" "\t[-b output_block_size (default: 16 * 16384)]\n" "\t[-S force sync output (default: async)]\n"); - #endif exit(1); } @@ -166,7 +161,6 @@ int main(int argc, char **argv) uint32_t out_block_size = DEFAULT_BUF_LENGTH; int device_count; -#ifndef _WIN32 while ((opt = getopt(argc, argv, "d:s:b:tS::")) != -1) { switch (opt) { case 'd': @@ -190,15 +184,6 @@ int main(int argc, char **argv) } } -#else -/* TODO fix win usage */ - if (argc < 3) - usage(); - dev_index = atoi(argv[1]); - samp_rate = atoi(argv[2])*1000; - if (argc >3 && argv[3][0] == '1') - tuner_benchmark = 1; -#endif if(out_block_size < MINIMAL_BUF_LENGTH || out_block_size > MAXIMAL_BUF_LENGTH ){ fprintf(stderr, -- cgit v1.2.3