diff options
Diffstat (limited to 'netsvcs/clients/Naming/Dump_Restore')
-rw-r--r-- | netsvcs/clients/Naming/Dump_Restore/Dump_Restore.cpp | 106 | ||||
-rw-r--r-- | netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h | 6 | ||||
-rw-r--r-- | netsvcs/clients/Naming/Dump_Restore/Makefile.am | 57 | ||||
-rw-r--r-- | netsvcs/clients/Naming/Dump_Restore/main.cpp | 6 |
4 files changed, 77 insertions, 98 deletions
diff --git a/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.cpp b/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.cpp index bfda59cd09f..f9a765d605e 100644 --- a/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.cpp +++ b/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.cpp @@ -16,7 +16,7 @@ ACE_RCSID(Dump_Restore, Dump_Restore, "$Id$") -Dump_Restore::Dump_Restore (int argc, ACE_TCHAR *argv[]) +Dump_Restore::Dump_Restore (int argc, char *argv[]) : infile_ (0) { ACE_NEW (this->ns_context_, @@ -28,12 +28,12 @@ Dump_Restore::Dump_Restore (int argc, ACE_TCHAR *argv[]) //determine name context if (ACE_OS::strcmp (this->name_options_->nameserver_host (), - ACE_TEXT ("localhost")) == 0) + "localhost") == 0) { if (ns_context_->open (ACE_Naming_Context::PROC_LOCAL) == -1) ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->open"))); + "%p\n", + "ns_context_->open")); } else { @@ -46,8 +46,8 @@ Dump_Restore::Dump_Restore (int argc, ACE_TCHAR *argv[]) if (this->ns_context_->open (ACE_Naming_Context::NET_LOCAL) == -1) ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->open"))); + "%p\n", + "ns_context_->open")); } this->display_menu (); @@ -56,8 +56,8 @@ Dump_Restore::Dump_Restore (int argc, ACE_TCHAR *argv[]) ACE_Reactor::instance (), ACE_Thread_Manager::instance ()) == -1) ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("register_stdin_handler"))); + "%p\n", + "register_stdin_handler")); } Dump_Restore::~Dump_Restore (void) @@ -80,7 +80,7 @@ Dump_Restore::handle_input (ACE_HANDLE) if (::scanf ("%s", option) <= 0) { ACE_DEBUG ((LM_ERROR, - ACE_TEXT ("try again\n"))); + "try again\n")); return 0; } @@ -98,7 +98,7 @@ Dump_Restore::handle_input (ACE_HANDLE) case 'h' : if (::scanf ("%s %hu", buf1, &port) <= 0) break; - set_host (ACE_TEXT_CHAR_TO_TCHAR (buf1), port); + set_host (buf1, port); break; case 'F': case 'f': @@ -131,7 +131,7 @@ Dump_Restore::handle_input (ACE_HANDLE) quit (); break; default : - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Unrecognized command.\n"))); + ACE_DEBUG ((LM_DEBUG, "Unrecognized command.\n")); } display_menu (); @@ -142,59 +142,59 @@ void Dump_Restore::display_menu (void) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\n"))); + "\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Name Service Main Menu\n"))); + "Name Service Main Menu\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("----------------------\n"))); + "----------------------\n")); // Check if using local name space or remote name space if (ACE_OS::strcmp (this->name_options_->nameserver_host (), - ACE_TEXT ("localhost")) == 0) + "localhost") == 0) { if (this->ns_scope_ == ACE_Naming_Context::PROC_LOCAL) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" *** Using Process Local Database ***\n\n"))); + " *** Using Process Local Database ***\n\n")); else ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" *** Using Node Local Database ***\n\n"))); + " *** Using Node Local Database ***\n\n")); } else { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" Hostname: %s\n"), + " Hostname: %s\n", this->hostname_)); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" Port Number: %d\n"), + " Port Number: %d\n", this->port_)); } if (this->infile_) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Input File: %C\n"), + "Input File: %s\n", this->filename_)); else ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("** No Input File Specified **\n"))); + "** No Input File Specified **\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<P> Use Process Local Database\n"))); + "<P> Use Process Local Database\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<N> Use Node Local Database\n"))); + "<N> Use Node Local Database\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<H> Set Remote Name server <host> and <port>\n"))); + "<H> Set Remote Name server <host> and <port>\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<F> Set Input File <file name>\n"))); + "<F> Set Input File <file name>\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<B> Bind\n"))); + "<B> Bind\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<U> Unbind\n"))); + "<U> Unbind\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<R> Rebind\n"))); + "<R> Rebind\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<D> Dump <file name>\n"))); + "<D> Dump <file name>\n")); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<Q> or ^C (exit) \n"))); + "<Q> or ^C (exit) \n")); } @@ -202,7 +202,7 @@ int Dump_Restore::set_proc_local (void) { // Set Name Options - this->name_options_->nameserver_host (ACE_TEXT ("localhost")); + this->name_options_->nameserver_host ("localhost"); this->name_options_->nameserver_port (0); // Set Naming Context scope @@ -219,8 +219,8 @@ Dump_Restore::set_proc_local (void) if (this->ns_context_->open (ACE_Naming_Context::PROC_LOCAL) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->open")), + "%p\n", + "ns_context_->open"), -1); return 0; @@ -230,7 +230,7 @@ int Dump_Restore::set_node_local (void) { // Set Name Options - this->name_options_->nameserver_host (ACE_TEXT ("localhost")); + this->name_options_->nameserver_host ("localhost"); this->name_options_->nameserver_port (0); // Set Naming Context scope @@ -246,14 +246,14 @@ Dump_Restore::set_node_local (void) if (ns_context_->open (ACE_Naming_Context::NODE_LOCAL) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->open")), + "%p\n", + "ns_context_->open"), -1); return 0; } int -Dump_Restore::set_host (const ACE_TCHAR *hostname, +Dump_Restore::set_host (const char *hostname, int port) { // Set Name Options @@ -262,9 +262,11 @@ Dump_Restore::set_host (const ACE_TCHAR *hostname, // Don't really need to do this but it's a hack to fix the problme // of Display () not printing the right hostname - ACE_OS::strcpy (this->hostname_, hostname); + ACE_OS::strcpy (this->hostname_, + hostname); this->port_ = port; - this->ns_scope_ = ACE_Naming_Context::NET_LOCAL; + this->ns_scope_ = + ACE_Naming_Context::NET_LOCAL; // remove old naming context delete this->ns_context_; @@ -277,8 +279,8 @@ Dump_Restore::set_host (const ACE_TCHAR *hostname, // assume net_local context if (ns_context_->open (ACE_Naming_Context::NET_LOCAL) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->open")), + "%p\n", + "ns_context_->open"), -1); return 0; } @@ -380,8 +382,8 @@ Dump_Restore::populate (Dump_Restore::Operation_Type op) break; default: ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("populate")), + "%p\n", + "populate"), -1); /* NOTREACHED */ } @@ -403,15 +405,15 @@ Dump_Restore::bind (const char *key, type); if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->bind")), + "%p\n", + "ns_context_->bind"), -1); else if (result == 1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%s%s%s\n"), - ACE_TEXT ("key <"), + "%s%s%s\n", + "key <", key, - ACE_TEXT ("> already bound")), + "> already bound"), 1); return 0; } @@ -423,8 +425,8 @@ Dump_Restore::unbind (const char *key) if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->unbind")), + "%p\n", + "ns_context_->unbind"), -1); return 0; } @@ -438,8 +440,8 @@ Dump_Restore::rebind (const char *key, value, type) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ns_context_->rebind")), + "%p\n", + "ns_context_->rebind"), -1); return 0; } diff --git a/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h b/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h index 1cdd2113f8e..72651ff6ad0 100644 --- a/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h +++ b/netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h @@ -21,7 +21,7 @@ public: UNBIND, REBIND }; - Dump_Restore (int argc, ACE_TCHAR *argv[]); + Dump_Restore (int argc, char *argv[]); // Initialize name options and naming context ~Dump_Restore (void); @@ -32,7 +32,7 @@ public: void dump (void); private: - ACE_TCHAR hostname_[MAXHOSTNAMELEN + 1]; + char hostname_[MAXHOSTNAMELEN + 1]; // Cache the hostname and port number for remote case void display_menu (void); @@ -44,7 +44,7 @@ private: int set_node_local (void); // Set options to use NODE_LOCAL naming context. - int set_host (const ACE_TCHAR *hostname, + int set_host (const char *hostname, int port); // Set options to use NET_LOCAL naming context specifying host name // and port number. diff --git a/netsvcs/clients/Naming/Dump_Restore/Makefile.am b/netsvcs/clients/Naming/Dump_Restore/Makefile.am index cc5dfd0c1c7..22a196c18fb 100644 --- a/netsvcs/clients/Naming/Dump_Restore/Makefile.am +++ b/netsvcs/clients/Naming/Dump_Restore/Makefile.am @@ -1,50 +1,27 @@ -## Process this file with automake to create Makefile.in +##---------------------------------------------------------------------------- +## $Id$ ## -## $Id$ +## Makefile for the ACE Dump-Restore Name_Server utility +##---------------------------------------------------------------------------- + ## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. +## Process this file with automake to create Makefile.in ## -## MPC Command: -## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -hierarchy -make_coexistence -exclude build,Kokyu - -ACE_BUILDDIR = $(top_builddir) - -## Makefile.Netsvcs_Dump_Restore_Lib.am -noinst_LTLIBRARIES = libDump_Restore.la - -libDump_Restore_la_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(ACE_BUILDDIR) \ - -DACE_BUILD_SVC_DLL - -libDump_Restore_la_SOURCES = \ - Dump_Restore.cpp - -libDump_Restore_la_LIBADD = \ - $(top_builddir)/ace/libACE.la -noinst_HEADERS = \ - Dump_Restore.h +AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -## Makefile.Netsvcs_Dump_Restore.am -noinst_PROGRAMS = main +noinst_LIBRARIES = \ + libDump_Restore.a -main_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(ACE_BUILDDIR) +libDump_Restore_a_SOURCES = Dump_Restore.cpp Dump_Restore.h -main_SOURCES = \ - main.cpp \ - Dump_Restore.h +noinst_PROGRAMS = \ + main +main_SOURCES = main.cpp main_LDADD = \ - libDump_Restore.la $(top_builddir)/ace/libACE.la + libDump_Restore.a \ + $(top_builddir)/ace/libACE.la -## Clean up template repositories, etc. -clean-local: - -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core - -rm -f gcctemp.c gcctemp so_locations - -rm -rf ptrepository SunWS_cache Templates.DB +## ACE currently doesn't build this so we don't build it with automake either. +EXTRA_DIST = createfile.cpp diff --git a/netsvcs/clients/Naming/Dump_Restore/main.cpp b/netsvcs/clients/Naming/Dump_Restore/main.cpp index 46d298357bc..4d90427edda 100644 --- a/netsvcs/clients/Naming/Dump_Restore/main.cpp +++ b/netsvcs/clients/Naming/Dump_Restore/main.cpp @@ -9,11 +9,11 @@ ACE_RCSID(Dump_Restore, main, "$Id$") int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +main (int argc, char *argv[]) { ACE_Service_Config daemon (argv[0]); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("entering main\n"))); + ACE_DEBUG ((LM_DEBUG, "entering main\n")); // Get a handler Dump_Restore client_handler (argc, argv); @@ -21,6 +21,6 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_Reactor::run_event_loop (); /* NOTREACHED */ - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("leaving main\n"))); + ACE_DEBUG ((LM_DEBUG, "leaving main\n")); return 0; } |