From 01a5b51315430bc714a194cd0a864d4e33d6682f Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 14 Dec 2024 23:51:29 -0500 Subject: rename getopt() so we can compile with g++ if needed. --- uxd.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'uxd.c') diff --git a/uxd.c b/uxd.c index 2502463..c4ad772 100644 --- a/uxd.c +++ b/uxd.c @@ -3,18 +3,6 @@ #include #include -extern int getopt(int, char **, char *); -extern char *optarg; -extern int optind; - -/* output looks like: - - 0 1 2 3 4 5 6 7 8 9 A B C D E F -0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 abcdefghijklmnop - -...first column will extend to more digits if needed. -*/ - /* UTF-8 spec summary, taken from Wikipedia and elsewhere, kept here for locality of reference. @@ -45,6 +33,11 @@ fe ff, it's UTF-16 big-endian. We detect these and print a warning on stderr. */ +/* from getopt.c */ +extern int my_getopt(int, char **, char *); +extern char *optarg; +extern int optind; + #ifndef VERSION #define VERSION "(unknown version)" #endif @@ -127,7 +120,7 @@ void parse_options(int argc, char **argv) { version(); } - while((opt = getopt(argc, argv, "l:rmo:s:uhv")) != -1) { + while((opt = my_getopt(argc, argv, "l:rmo:s:uhv")) != -1) { switch(opt) { case 'l': limit = parse_number(optarg); break; -- cgit v1.2.3