diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-05 12:15:18 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-05 12:15:18 +0000 |
commit | 7d060e649ea62286b8bfc8122acb3a7cfb93358e (patch) | |
tree | 7e4663201c79baf854061cf79bd9fbc192c0be8b | |
parent | ba60549a851c698e7f45ece76064bfd846fcdc83 (diff) | |
download | ATCD-7d060e649ea62286b8bfc8122acb3a7cfb93358e.tar.gz |
Fri Jan 5 12:14:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | CIAO/ChangeLog | 12 | ||||
-rw-r--r-- | CIAO/DAnCE/RepositoryManager/PC_Updater.cpp | 2 | ||||
-rw-r--r-- | CIAO/DAnCE/RepositoryManager/RMadmin.cpp | 7 | ||||
-rw-r--r-- | CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp | 12 | ||||
-rw-r--r-- | CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp | 2 | ||||
-rw-r--r-- | CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h | 40 | ||||
-rw-r--r-- | CIAO/DAnCE/RepositoryManager/URL_Parser.cpp | 71 |
7 files changed, 77 insertions, 69 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 8360a85eb79..2a282630ee7 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,15 @@ +Fri Jan 5 12:14:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/RepositoryManager/RepositoryManager.cpp: + * DAnCE/RepositoryManager/RepositoryManager_Impl.cpp: + * DAnCE/RepositoryManager/RepositoryManager_Impl.h: + Fixed conversion warnings + + * DAnCE/RepositoryManager/PC_Updater.cpp: + * DAnCE/RepositoryManager/RMadmin.cpp: + * DAnCE/RepositoryManager/URL_Parser.cpp: + Improved layout and documentation + Wed Jan 3 19:32:05 UTC 2007 Chad Elliott <elliott_c@ociweb.com> * CIAO_TAO_DAnCE.mwc: diff --git a/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp b/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp index c8a04d11484..d2ce75e8666 100644 --- a/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp +++ b/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp @@ -169,7 +169,7 @@ void PC_Updater::clear_list () { const char* location = CORBA::string_dup (iad.location[0]); - //create an interator + //create an iterator ACE_Double_Linked_List_Iterator<ZIP_File_Info> iter (this->file_list_); //find the correct path and return diff --git a/CIAO/DAnCE/RepositoryManager/RMadmin.cpp b/CIAO/DAnCE/RepositoryManager/RMadmin.cpp index aa6e182ddc1..61803ce1347 100644 --- a/CIAO/DAnCE/RepositoryManager/RMadmin.cpp +++ b/CIAO/DAnCE/RepositoryManager/RMadmin.cpp @@ -1,4 +1,3 @@ - /* -*- C++ -*- */ /*** @@ -101,9 +100,9 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } if (options->shutdown_) - { - rm->shutdown (); - } + { + rm->shutdown (); + } else if (options->all_names_) { try diff --git a/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp b/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp index 6312909c1e5..fe8c009efa6 100644 --- a/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp +++ b/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp @@ -34,10 +34,10 @@ namespace CIAO const char * RMior = "RepositoryManagerDaemon.ior"; // Name of RepoMan - char * repoman_name_ = "RepositoryManager"; + const char * repoman_name_ = "RepositoryManager"; //Name service of the RM - char * RMname_service = "RepositoryManager"; + const char * RMname_service = "RepositoryManager"; /// Default number of worker threads to run in the multi-threaded RM static unsigned int nthreads = 3; @@ -143,17 +143,17 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (!parse_args (argc, argv)) return -1; - //Get the root POA object + // Get the root POA object CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); - //downcast to POA type + // Downcast to POA type PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in ()); //activate the POA manager PortableServer::POAManager_var mgr = root_poa->the_POAManager (); mgr->activate (); - //create a servant + // Create a servant CIAO_RepositoryManagerDaemon_i* repo = 0; ACE_NEW_RETURN (repo, CIAO_RepositoryManagerDaemon_i ( @@ -162,7 +162,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) CIAO::RepositoryManager::repoman_name_), 1); - //trasfer ownership to the POA + //transfer ownership to the POA PortableServer::ServantBase_var owner_transfer(repo); //register and implicitly activate servant diff --git a/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp b/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp index 35297e35a35..e031c81854f 100644 --- a/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp +++ b/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp @@ -63,7 +63,7 @@ namespace //----------------------------------------------------------------- CIAO_RepositoryManagerDaemon_i::CIAO_RepositoryManagerDaemon_i - (CORBA::ORB_ptr the_orb, const char* server, char* install_dir) + (CORBA::ORB_ptr the_orb, const char* server, const char* install_dir) : the_orb_ (CORBA::ORB::_duplicate (the_orb)), install_root_ (""), HTTP_server_ ("http://"), diff --git a/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h b/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h index e99c649508f..0c371d7c758 100644 --- a/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h +++ b/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h @@ -55,7 +55,7 @@ public: /// Constructor CIAO_RepositoryManagerDaemon_i (CORBA::ORB_ptr the_orb, const char* server = "localhost:5432", - char* install_dir = "RepositoryManager"); + const char* install_dir = "RepositoryManager"); /// Destructor virtual ~CIAO_RepositoryManagerDaemon_i (void); @@ -163,7 +163,6 @@ protected: /// stores the file in the passed preallocated ACE_Message_Block /// @retval 1 success /// @retval 0 error - int HTTP_Get (const char* URL, ACE_Message_Block &mb); /// Function to extract all necessary files for parsing the @@ -172,7 +171,6 @@ protected: /// @retval 0 error /// /// @note ACE_CString& pcd_name is an out parameter - int extract_descriptor_files (char* package, ACE_CString& pcd_name); @@ -182,37 +180,33 @@ protected: /// from the package. They correspond to the names on disk. /// @retval 1 on success /// @retval 0 on error - int remove_descriptor_files (char* package); - ///function to remove the files extracted from the package upon istallation - ///It reads the names of the files from the package. They correspond to the - ///names on disk. It deletes each file, then it deletes the directories that - ///contain them. - ///NOTE: extraction location is path/*archive_name*/ - ///returns 1 on success - /// 0 on error - + /// Function to remove the files extracted from the package upon istallation + /// It reads the names of the files from the package. They correspond to the + /// names on disk. It deletes each file, then it deletes the directories that + /// contain them. + /// @note extraction location is path/*archive_name*/ + /// @retval 1 on success + /// @retval 0 on error int remove_extracted_package (const char* package_path, const char* extraction_location); - ///function to extract the type of the component from - ///the PackageConfiguration and update the interface map - ///returns 1 on success - /// 0 on error - + /// Function to extract the type of the component from + /// the PackageConfiguration and update the interface map + /// @retval 1 on success + /// @retval 0 on error int add_type (::Deployment::PackageConfiguration& pc, const char* name); - ///function to remove the interface type of the component - ///being removed from the interface map - ///returns 1 on success - /// 0 on error - + /// Function to remove the interface type of the component + /// being removed from the interface map + /// @retval 1 on success + /// @retval 0 on error int remove_type (::Deployment::PackageConfiguration& pc, const char* name); - ///function to dump the state of the RepositoryManager + /// Function to dump the state of the RepositoryManager void dump (void); private: diff --git a/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp b/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp index 25ddcc9fa3c..3024606da7f 100644 --- a/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp +++ b/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp @@ -20,15 +20,18 @@ URL_Parser::parse_args (int argc, ACE_TCHAR *argv[]) case 'd': this->debug_ = true; break; - case 'u': - success = parseURL (get_opt.opt_arg ()); - break; + case 'u': + success = parseURL (get_opt.opt_arg ()); + break; // Usage fallthrough. default: success = false; } + if (this->hostname_ == 0 || this->filename_ == 0) - success = false; + { + success = false; + } return success; } @@ -50,34 +53,37 @@ bool URL_Parser::parseURL (char* url) url += ACE_OS::strlen ("http://"); if (url[0] == '/') - { - this->filename_ = ACE_OS::strdup (url); - } + { + this->filename_ = ACE_OS::strdup (url); + } else - { ptr = ACE_OS::strstr (url, ":"); - if (ptr) - this->port_ = ACE_OS::atoi (ptr + 1); - else - ptr = ACE_OS::strstr (url, "/"); - - if(!ptr) - success = false; - else { - size_t host_len = ptr - url; - ACE_NEW_RETURN (this->hostname_, char [host_len + 1], false); - ACE_OS::strncpy (this->hostname_, url, host_len); - this->hostname_ [host_len] = '\0'; - ptr = ACE_OS::strstr (ptr, "/"); + ptr = ACE_OS::strstr (url, ":"); if (ptr) - { - this->filename_ = ACE_OS::strdup(ptr); - } + this->port_ = ACE_OS::atoi (ptr + 1); else + ptr = ACE_OS::strstr (url, "/"); + + if(!ptr) success = false; + else + { + size_t host_len = ptr - url; + ACE_NEW_RETURN (this->hostname_, char [host_len + 1], false); + ACE_OS::strncpy (this->hostname_, url, host_len); + this->hostname_ [host_len] = '\0'; + ptr = ACE_OS::strstr (ptr, "/"); + if (ptr) + { + this->filename_ = ACE_OS::strdup(ptr); + } + else + { + success = false; + } + } } - } - return success; + return success; } @@ -86,17 +92,14 @@ void URL_Parser::Error (void) ACE_DEBUG ((LM_DEBUG, "./http_client -u http://hostname:port/filename [-d]\n")); } - - URL_Parser::~URL_Parser() - { - if(this->hostname_) +URL_Parser::~URL_Parser() +{ + if(this->hostname_) { delete [] this->hostname_; - this->hostname_ =0; } - if (this->filename_) + if (this->filename_) { ACE_OS::free (this->filename_); - this->filename_ = 0; } - } +} |