aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtl_test.c
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2012-05-29 01:47:44 +0200
committerSteve Markgraf <steve@steve-m.de>2012-05-29 02:13:18 +0200
commitd08c4770abbd13ad8f474adc709adb20996662d5 (patch)
tree5c6368e1c53747ebaccdef6e875616f8e804cce9 /src/rtl_test.c
parentbc2c44505539f8c0f509df6d871519383710aaef (diff)
add local copy of getopt() for win32 build
Now all commandline utilities have a platform-independent syntax. Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/rtl_test.c')
-rw-r--r--src/rtl_test.c17
1 files changed, 1 insertions, 16 deletions
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 <unistd.h>
#else
#include <Windows.h>
+#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,