diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-12-26 15:46:44 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-12-26 15:46:44 +0000 |
commit | c13d83545ee97972e556b1fdc6eb81c318435f76 (patch) | |
tree | 3e074e160a2e59a236f10781cfcb0e071b49fac8 /apps | |
parent | 5a4937548f54d003dc238b834281b3f3b43067dd (diff) | |
download | ATCD-c13d83545ee97972e556b1fdc6eb81c318435f76.tar.gz |
ChangeLogTag:Wed Dec 26 09:07:45 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Gateway/Gateway/Options.cpp | 14 | ||||
-rw-r--r-- | apps/Gateway/Peer/Options.cpp | 12 | ||||
-rw-r--r-- | apps/JAWS/ChangeLog | 8 | ||||
-rw-r--r-- | apps/JAWS/clients/Blobby/Options.cpp | 10 | ||||
-rw-r--r-- | apps/JAWS/server/HTTP_Server.cpp | 22 | ||||
-rw-r--r-- | apps/JAWS/stress_testing/benchd.cpp | 2 | ||||
-rw-r--r-- | apps/JAWS2/JAWS/Server.cpp | 18 | ||||
-rw-r--r-- | apps/drwho/Options.cpp | 14 | ||||
-rw-r--r-- | apps/gperf/src/Options.cpp | 46 |
9 files changed, 77 insertions, 69 deletions
diff --git a/apps/Gateway/Gateway/Options.cpp b/apps/Gateway/Gateway/Options.cpp index a5edd01fdb9..d13848835bf 100644 --- a/apps/Gateway/Gateway/Options.cpp +++ b/apps/Gateway/Gateway/Options.cpp @@ -183,7 +183,7 @@ Options::parse_args (int argc, char *argv[]) { // Become an Acceptor. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -210,7 +210,7 @@ Options::parse_args (int argc, char *argv[]) break; case 'C': // Use a different proxy config filename. ACE_OS::strncpy (this->consumer_config_file_, - get_opt.optarg, + get_opt.opt_arg (), sizeof this->consumer_config_file_ / sizeof (ACE_TCHAR)); break; @@ -218,7 +218,7 @@ Options::parse_args (int argc, char *argv[]) { // Become a Connector. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -246,15 +246,15 @@ Options::parse_args (int argc, char *argv[]) break; case 'P': // Use a different connection config filename. ACE_OS::strncpy (this->connection_config_file_, - get_opt.optarg, + get_opt.opt_arg (), sizeof this->connection_config_file_); break; case 'q': // Use a different socket queue size. - this->socket_queue_size_ = ACE_OS::atoi (get_opt.optarg); + this->socket_queue_size_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': // Use a different threading strategy. { - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strcmp (flag, "OUTPUT_MT") == 0) @@ -270,7 +270,7 @@ Options::parse_args (int argc, char *argv[]) Options::VERBOSE); break; case 'w': // Time performance for a designated amount of time. - this->performance_window_ = ACE_OS::atoi (get_opt.optarg); + this->performance_window_ = ACE_OS::atoi (get_opt.opt_arg ()); // Use blocking connection semantics so that we get accurate // timings (since all connections start at once). this->blocking_semantics_ = 0; diff --git a/apps/Gateway/Peer/Options.cpp b/apps/Gateway/Peer/Options.cpp index 80c0256b619..e4c5842c696 100644 --- a/apps/Gateway/Peer/Options.cpp +++ b/apps/Gateway/Peer/Options.cpp @@ -114,7 +114,7 @@ Options::parse_args (int argc, char *argv[]) { // Become an Acceptor. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -140,7 +140,7 @@ Options::parse_args (int argc, char *argv[]) { // Become a Connector. - for (char *flag = ACE_OS::strtok (get_opt.optarg, "|"); + for (char *flag = ACE_OS::strtok (get_opt.opt_arg (), "|"); flag != 0; flag = ACE_OS::strtok (0, "|")) if (ACE_OS::strncasecmp (flag, "C", 1) == 0) @@ -163,22 +163,22 @@ Options::parse_args (int argc, char *argv[]) break; /* NOTREACHED */ case 'C': - this->connection_id_ = ACE_OS::atoi (get_opt.optarg); + this->connection_id_ = ACE_OS::atoi (get_opt.opt_arg ()); break; /* NOTREACHED */ case 'h': // connector host - this->connector_host_ = get_opt.optarg; + this->connector_host_ = get_opt.opt_arg (); break; /* NOTREACHED */ case 'm': // max queue size. - this->max_queue_size_ = ACE_OS::atoi (get_opt.optarg); + this->max_queue_size_ = ACE_OS::atoi (get_opt.opt_arg ()); break; /* NOTREACHED */ case 't': // Timeout - this->timeout_ = ACE_OS::atoi (get_opt.optarg); + this->timeout_ = ACE_OS::atoi (get_opt.opt_arg ()); break; /* NOTREACHED */ case 'v': diff --git a/apps/JAWS/ChangeLog b/apps/JAWS/ChangeLog index e75cc59c33e..140e3ad1b07 100644 --- a/apps/JAWS/ChangeLog +++ b/apps/JAWS/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 26 09:35:35 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * clients/Blobby/Options.cpp + server/HTTP_Server.cpp + stress_testing/benchd.cpp + JAWS2/JAWS/Server.cpp: Replaced all uses of getopt.optarg + with getopt.opt_arg(). + Thu Dec 6 09:00:31 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * clients/Caching/http_client.cpp (main): Make sure to remove the diff --git a/apps/JAWS/clients/Blobby/Options.cpp b/apps/JAWS/clients/Blobby/Options.cpp index 4c28033ae19..08f7de4ad8b 100644 --- a/apps/JAWS/clients/Blobby/Options.cpp +++ b/apps/JAWS/clients/Blobby/Options.cpp @@ -40,19 +40,19 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) this->operation_ = 'w'; break; case 'h': - this->hostname_ = get_opt.optarg; + this->hostname_ = get_opt.opt_arg (); break; case 'p': - this->port_ = ACE_OS::atoi (get_opt.optarg); + this->port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'f': - this->filename_ = get_opt.optarg; + this->filename_ = get_opt.opt_arg (); break; case 'l': - this->length_ = ACE_OS::atoi (get_opt.optarg); + this->length_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'o': - this->offset_ = ACE_OS::atoi (get_opt.optarg); + this->offset_ = ACE_OS::atoi (get_opt.opt_arg ()); break; // Usage fallthrough. default: diff --git a/apps/JAWS/server/HTTP_Server.cpp b/apps/JAWS/server/HTTP_Server.cpp index 146a7c04d8b..8de242b2df5 100644 --- a/apps/JAWS/server/HTTP_Server.cpp +++ b/apps/JAWS/server/HTTP_Server.cpp @@ -50,49 +50,49 @@ HTTP_Server::parse_args (int argc, switch (c) { case 'p': - this->port_ = ACE_OS::atoi (get_opt.optarg); + this->port_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 'n': - this->threads_ = ACE_OS::atoi (get_opt.optarg); + this->threads_ = ACE_OS::atoi (get_opt.opt_arg ()); break; case 't': // POOL -> thread pool // PER_REQUEST -> thread per request // THROTTLE -> thread per request with throttling - if (ACE_OS::strcmp (get_opt.optarg, "POOL") == 0) + if (ACE_OS::strcmp (get_opt.opt_arg (), "POOL") == 0) thr_strategy = JAWS::POOL; - else if (ACE_OS::strcmp (get_opt.optarg, "PER_REQUEST") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "PER_REQUEST") == 0) { thr_strategy = JAWS::PER_REQUEST; this->throttle_ = 0; } - else if (ACE_OS::strcmp (get_opt.optarg, "THROTTLE") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "THROTTLE") == 0) { thr_strategy = JAWS::PER_REQUEST; this->throttle_ = 1; } break; case 'f': - if (ACE_OS::strcmp (get_opt.optarg, "THR_BOUND") == 0) + if (ACE_OS::strcmp (get_opt.opt_arg (), "THR_BOUND") == 0) { // What happened here? } - else if (ACE_OS::strcmp (get_opt.optarg, "THR_DAEMON") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "THR_DAEMON") == 0) { } - else if (ACE_OS::strcmp (get_opt.optarg, "THR_DETACHED") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "THR_DETACHED") == 0) { } case 'i': // SYNCH -> synchronous I/O // ASYNCH -> asynchronous I/O - if (ACE_OS::strcmp (get_opt.optarg, "SYNCH") == 0) + if (ACE_OS::strcmp (get_opt.opt_arg (), "SYNCH") == 0) io_strategy = JAWS::SYNCH; - else if (ACE_OS::strcmp (get_opt.optarg, "ASYNCH") == 0) + else if (ACE_OS::strcmp (get_opt.opt_arg (), "ASYNCH") == 0) io_strategy = JAWS::ASYNCH; break; case 'b': - this->backlog_ = ACE_OS::atoi (get_opt.optarg); + this->backlog_ = ACE_OS::atoi (get_opt.opt_arg ()); break; default: break; diff --git a/apps/JAWS/stress_testing/benchd.cpp b/apps/JAWS/stress_testing/benchd.cpp index 2c6dfcbd526..ff17f669430 100644 --- a/apps/JAWS/stress_testing/benchd.cpp +++ b/apps/JAWS/stress_testing/benchd.cpp @@ -184,7 +184,7 @@ parse_args (int argc, char *argv[]) case 'q': QUIET = 1; case 'i': - INTERFACE = get_opt.optarg; + INTERFACE = get_opt.opt_arg (); break; case 'u': // Usage fallthrough. diff --git a/apps/JAWS2/JAWS/Server.cpp b/apps/JAWS2/JAWS/Server.cpp index 629bd00d1f4..9c729bc6c81 100644 --- a/apps/JAWS2/JAWS/Server.cpp +++ b/apps/JAWS2/JAWS/Server.cpp @@ -148,34 +148,34 @@ JAWS_Server::parse_args (int argc, char *argv[]) t = !t; break; case 'p': - this->port_ = ACE_OS::atoi (getopt.optarg); + this->port_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'c': - if (ACE_OS::strcmp (getopt.optarg, "PER_REQUEST") == 0) + if (ACE_OS::strcmp (getopt.opt_arg (), "PER_REQUEST") == 0) this->concurrency_ = 1; else this->concurrency_ = 0; break; case 'd': - if (ACE_OS::strcmp (getopt.optarg, "ASYNCH") == 0) + if (ACE_OS::strcmp (getopt.opt_arg (), "ASYNCH") == 0) this->dispatch_ = 1; else this->dispatch_ = 0; break; case 'n': - this->nthreads_ = ACE_OS::atoi (getopt.optarg); + this->nthreads_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'm': - this->maxthreads_ = ACE_OS::atoi (getopt.optarg); + this->maxthreads_ = ACE_OS::atoi (getopt.opt_arg ()); break; case 'f': - if (ACE_OS::strcmp (getopt.optarg, "THR_BOUND") == 0) + if (ACE_OS::strcmp (getopt.opt_arg (), "THR_BOUND") == 0) this->flags_ |= THR_BOUND; - else if (ACE_OS::strcmp (getopt.optarg, "THR_DAEMON") == 0) + else if (ACE_OS::strcmp (getopt.opt_arg (), "THR_DAEMON") == 0) this->flags_ |= THR_DAEMON; - else if (ACE_OS::strcmp (getopt.optarg, "THR_DETACHED") == 0) + else if (ACE_OS::strcmp (getopt.opt_arg (), "THR_DETACHED") == 0) this->flags_ |= THR_DETACHED; break; case 'r': - this->ratio_ = ACE_OS::atoi (getopt.optarg); + this->ratio_ = ACE_OS::atoi (getopt.opt_arg ()); break; } diff --git a/apps/drwho/Options.cpp b/apps/drwho/Options.cpp index 4b82de0563a..577d35a2b7a 100644 --- a/apps/drwho/Options.cpp +++ b/apps/drwho/Options.cpp @@ -88,7 +88,7 @@ Options::set_options (int argc, char *argv[]) Options::print_usage_and_die (0); /* NOTREACHED */ case 'A': - Multicast_Manager::add_host (getopt.optarg); + Multicast_Manager::add_host (getopt.opt_arg ()); break; case 'a': Options::protocol_type = PROTO_ALL; @@ -100,10 +100,10 @@ Options::set_options (int argc, char *argv[]) Options::set_opt (Options::DEBUG); break; case 'f': - Options::friend_file = getopt.optarg; + Options::friend_file = getopt.opt_arg (); break; case 'F': - if (Multicast_Manager::insert_hosts_from_file (getopt.optarg) < 0) + if (Multicast_Manager::insert_hosts_from_file (getopt.opt_arg ()) < 0) ACE_DEBUG ((LM_DEBUG, "%p%a\n", Options::program_name, @@ -111,7 +111,7 @@ Options::set_options (int argc, char *argv[]) add_default_hosts = 0; break; case 'H': - Multicast_Manager::add_host (getopt.optarg); + Multicast_Manager::add_host (getopt.opt_arg ()); add_default_hosts = 0; break; case 'h': @@ -124,7 +124,7 @@ Options::set_options (int argc, char *argv[]) Options::set_opt (Options::USE_VERBOSE_FORMAT); break; case 'p': - Options::port_number = atoi (getopt.optarg); + Options::port_number = atoi (getopt.opt_arg ()); break; case 'R': Options::protocol_type = PROTO_RUSER; @@ -139,10 +139,10 @@ Options::set_options (int argc, char *argv[]) Options::set_opt (Options::SORT_BY_REAL_NAME); break; case 't': - Options::max_server_timeout = atoi (getopt.optarg); + Options::max_server_timeout = atoi (getopt.opt_arg ()); break; case 'w': - Options::user_name = getopt.optarg; + Options::user_name = getopt.opt_arg (); Options::protocol_type = PROTO_USR; break; default: diff --git a/apps/gperf/src/Options.cpp b/apps/gperf/src/Options.cpp index 07d3e2311b5..5355ecdf8e8 100644 --- a/apps/gperf/src/Options.cpp +++ b/apps/gperf/src/Options.cpp @@ -316,7 +316,7 @@ Options::parse_args (int argc, char *argv[]) // Allows user to provide keyword/attribute separator case 'e': { - delimiters_ = getopt.optarg; + delimiters_ = getopt.opt_arg (); break; } case 'E': @@ -328,7 +328,7 @@ Options::parse_args (int argc, char *argv[]) case 'f': { ACE_SET_BITS (option_word_, FAST); - iterations_ = atoi (getopt.optarg); + iterations_ = atoi (getopt.opt_arg ()); if (iterations_ < 0) { ACE_ERROR ((LM_ERROR, "iterations value must not be negative, assuming 0\n")); @@ -448,13 +448,13 @@ Options::parse_args (int argc, char *argv[]) // Sets the name for the hash function. case 'H': { - hash_name_ = getopt.optarg; + hash_name_ = getopt.opt_arg (); break; } // Sets the initial value for the associated values array. case 'i': { - initial_asso_value_ = atoi (getopt.optarg); + initial_asso_value_ = atoi (getopt.opt_arg ()); if (initial_asso_value_ < 0) ACE_ERROR ((LM_ERROR, "Initial value %d should be non-zero, ignoring and continuing.\n", @@ -472,7 +472,7 @@ Options::parse_args (int argc, char *argv[]) // Sets the jump value, must be odd for later algorithms. case 'j': { - jump_ = atoi (getopt.optarg); + jump_ = atoi (getopt.opt_arg ()); if (jump_ < 0) ACE_ERROR_RETURN ((LM_ERROR, "Jump value %d must be a positive number.\n%r", @@ -496,7 +496,7 @@ Options::parse_args (int argc, char *argv[]) { const int BAD_VALUE = -1; int value; - Iterator expand (getopt.optarg, + Iterator expand (getopt.opt_arg (), 1, MAX_KEY_POS - 1, WORD_END, @@ -504,7 +504,7 @@ Options::parse_args (int argc, char *argv[]) EOS); // Use all the characters for hashing!!!! - if (*getopt.optarg == '*') + if (*getopt.opt_arg () == '*') option_word_ = (option_word_ & ~DEFAULTCHARS) | ALLCHARS; else { @@ -545,7 +545,7 @@ Options::parse_args (int argc, char *argv[]) // Make this the keyname for the keyword component field. case 'K': { - key_name_ = getopt.optarg; + key_name_ = getopt.opt_arg (); break; } // Create length table to avoid extra string compares. @@ -558,15 +558,15 @@ Options::parse_args (int argc, char *argv[]) case 'L': { option_word_ &= ~C; - if (!ACE_OS::strcmp (getopt.optarg, "C++")) + if (!ACE_OS::strcmp (getopt.opt_arg (), "C++")) ACE_SET_BITS (option_word_, (CPLUSPLUS | ANSI)); - else if (!ACE_OS::strcmp (getopt.optarg, "C")) + else if (!ACE_OS::strcmp (getopt.opt_arg (), "C")) ACE_SET_BITS (option_word_, C); else { ACE_ERROR ((LM_ERROR, "unsupported language option %s, defaulting to C\n", - getopt.optarg)); + getopt.opt_arg ())); ACE_SET_BITS (option_word_, C); } break; @@ -589,16 +589,16 @@ Options::parse_args (int argc, char *argv[]) ACE_SET_BITS (option_word_, NOLENGTH); break; } - // Make generated lookup function name be optarg + // Make generated lookup function name be.opt_arg () case 'N': { - function_name_ = getopt.optarg; + function_name_ = getopt.opt_arg (); break; } - // Make fill_default be optarg + // Make fill_default be.opt_arg () case 'F': { - fill_default_ = getopt.optarg; + fill_default_ = getopt.opt_arg (); break; } // Order input by frequency of key set occurrence. @@ -631,7 +631,7 @@ Options::parse_args (int argc, char *argv[]) // Range of associated values, determines size of final table. case 's': { - size_ = atoi (getopt.optarg); + size_ = atoi (getopt.opt_arg ()); if (abs (size_) > 50) ACE_ERROR ((LM_ERROR, "%d is excessive, did you really mean this?! (type %n -h for help)\n", @@ -642,11 +642,11 @@ Options::parse_args (int argc, char *argv[]) case 'S': { ACE_SET_BITS (option_word_, SWITCH); - total_switches_ = atoi (getopt.optarg); + total_switches_ = atoi (getopt.opt_arg ()); if (total_switches_ <= 0) ACE_ERROR_RETURN ((LM_ERROR, "number of switches %s must be a positive number\n%r", - getopt.optarg, + getopt.opt_arg (), &Options::usage), -1); break; @@ -680,7 +680,7 @@ Options::parse_args (int argc, char *argv[]) // Set the class name. case 'Z': { - class_name_ = getopt.optarg; + class_name_ = getopt.opt_arg (); break; } default: @@ -692,16 +692,16 @@ Options::parse_args (int argc, char *argv[]) } - if (argv[getopt.optind] && - freopen (argv[getopt.optind], + if (argv[getopt.opt_ind ()] && + freopen (argv[getopt.opt_ind ()], "r", stdin) == 0) ACE_ERROR_RETURN ((LM_ERROR, "Cannot open keyword file %p\n%r", - argv[getopt.optind], + argv[getopt.opt_ind ()], &Options::usage), -1); - if (getopt.optind + 1 < argc) + if (getopt.opt_ind () + 1 < argc) ACE_ERROR_RETURN ((LM_ERROR, "Extra trailing arguments to %n.\n%r", usage), |