From ae4ffd933db55029b0f5b5fbc8e1e8a0cc265c38 Mon Sep 17 00:00:00 2001 From: Peter Baker Date: Tue, 28 Jun 2011 20:59:15 -0700 Subject: [PATCH] Update code to compile under Mac OS X. --- disp_basic.c | 1 + sersniff.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/disp_basic.c b/disp_basic.c index d1c5015..f1f97ca 100644 --- a/disp_basic.c +++ b/disp_basic.c @@ -21,6 +21,7 @@ */ #include +#include #include "disp_basic.h" diff --git a/sersniff.c b/sersniff.c index 52db00d..f12faf4 100644 --- a/sersniff.c +++ b/sersniff.c @@ -228,26 +228,26 @@ void mainloop(int port1, int port2, int silent, int alpha, long usec_threshold, void usage() { - fprintf(stderr,"sersniff v%s - -Usage: -sersniff [-h] [-i DEV | -l PORT] [-o DEV | -c HOST:PORT] [-b BAUD] [-w USEC] --h This help --x Show hex characters instead of alpha --f PRINTF_OPTS printf style options for printing hex characters - when '-x' switch is given (default \"<%%02hX>\") --i DEVICE Port 1 device (defaults to /dev/ttyS0). Use host:port for - TCP. --1 PORT1_NAME Port 1 name to be printed (defaults to 'Port1') --o DEVICE Port 2 device (defaults to /dev/ttyS1). Use :port for TCP. --2 PORT2_NAME Port 2 name to be printed (defaults to 'Port2') --b BAUD Baud rate (Defaults to 19200) --n No port configuration (do not set BAUD or change settings) --w USECS How many microsecs to wait before reporting a delay - (default is %d) --s Silent - don't pass data from port1 <=> port2, - just display what we see from them. -",VERSION,USEC); + fprintf(stderr,"sersniff v%s\n" + +"Usage:\n" +"sersniff [-h] [-i DEV | -l PORT] [-o DEV | -c HOST:PORT] [-b BAUD] [-w USEC]\n" +"-h This help\n" +"-x Show hex characters instead of alpha\n" +"-f PRINTF_OPTS printf style options for printing hex characters\n" +" when '-x' switch is given (default \"<%%02hX>\")\n" +"-i DEVICE Port 1 device (defaults to /dev/ttyS0). Use host:port for\n" +" TCP.\n" +"-1 PORT1_NAME Port 1 name to be printed (defaults to 'Port1')\n" +"-o DEVICE Port 2 device (defaults to /dev/ttyS1). Use :port for TCP.\n" +"-2 PORT2_NAME Port 2 name to be printed (defaults to 'Port2')\n" +"-b BAUD Baud rate (Defaults to 19200)\n" +"-n No port configuration (do not set BAUD or change settings)\n" +"-w USECS How many microsecs to wait before reporting a delay\n" +" (default is %d)\n" +"-s Silent - don't pass data from port1 <=> port2,\n" +" just display what we see from them.\n" +,VERSION,USEC); exit(1); } -- 2.39.5