diff options
Diffstat (limited to 'TAO/examples/POA/DSI/client.cpp')
-rw-r--r-- | TAO/examples/POA/DSI/client.cpp | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/TAO/examples/POA/DSI/client.cpp b/TAO/examples/POA/DSI/client.cpp index f8f581698c9..589559e0705 100644 --- a/TAO/examples/POA/DSI/client.cpp +++ b/TAO/examples/POA/DSI/client.cpp @@ -21,7 +21,7 @@ ACE_RCSID(DSI, client, "$Id$") -static const char *IOR = 0; +static char *IOR = 0; static const char *IOR_file = 0; static int shutdown_server = 0; @@ -71,7 +71,8 @@ int read_IOR_from_file (void) { // Open the file for reading. - ACE_HANDLE f_handle = ACE_OS::open (IOR_file, 0); + ACE_HANDLE f_handle = + ACE_OS::open (IOR_file, 0); if (f_handle == ACE_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, @@ -106,10 +107,14 @@ main (int argc, char **argv) { ACE_OS::strcpy (str, "CORBA::ORB_init"); - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV); + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + + 0, ACE_TRY_ENV); ACE_TRY_CHECK; - // Parse the command-line arguments to get the location of the IOR + // Parse the command-line arguments to get the location of the + // IOR if (parse_args (argc, argv) == -1) return -1; @@ -117,28 +122,36 @@ main (int argc, char **argv) { int result = read_IOR_from_file (); if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, "Cannot read IOR from %s\n", IOR_file), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot read IOR from %s\n", + IOR_file), + -1); } - ACE_OS::strcpy (str, "CORBA::ORB::string_to_object"); + ACE_OS::strcpy (str, + "CORBA::ORB::string_to_object"); // Get the object reference with the IOR CORBA::Object_var object = orb->string_to_object (IOR, ACE_TRY_ENV); ACE_TRY_CHECK; - ACE_OS::strcpy (str,"Database::Agent::_narrow"); + ACE_OS::strcpy (str, + "Database::Agent::_narrow"); // Narrow the object reference to a Database::Agent - Database::Agent_var database_agent = Database::Agent::_narrow (object.in (), - ACE_TRY_ENV); + Database::Agent_var database_agent = + Database::Agent::_narrow (object.in (), + ACE_TRY_ENV); ACE_TRY_CHECK; Database::NVPairSequence employee_attributes (2); employee_attributes.length (2); - Database::NamedValue &first = employee_attributes[0]; - Database::NamedValue &second = employee_attributes[1]; + Database::NamedValue &first = + employee_attributes[0]; + Database::NamedValue &second = + employee_attributes[1]; char *name = "irfan"; CORBA::Long id = 555; @@ -151,16 +164,18 @@ main (int argc, char **argv) ACE_OS::strcpy (str,"Database::Agent::create_entry"); // Create an employee - Database::Entry_var entry = database_agent->create_entry ("irfan", - "Employee", - employee_attributes, - ACE_TRY_ENV); + Database::Entry_var entry = + database_agent->create_entry ("irfan", + "Employee", + employee_attributes, + ACE_TRY_ENV); ACE_TRY_CHECK; ACE_OS::strcpy (str, "Database::Employee::_narrow"); - Database::Employee_var employee = Database::Employee::_narrow (entry.in (), - ACE_TRY_ENV); + Database::Employee_var employee = + Database::Employee::_narrow (entry.in (), + ACE_TRY_ENV); ACE_TRY_CHECK; /* |