summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2001-11-28 09:00:58 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2001-11-28 09:00:58 +0000
commit076acf8d48646422624fc5feeb45a8ffb6bf4c5d (patch)
tree4ff5b51389a424ab569ab37ce372b1e78e71890f /examples
parent3d3d5d49432ad200ecc46bce9f58bacf1cf237d4 (diff)
downloadATCD-076acf8d48646422624fc5feeb45a8ffb6bf4c5d.tar.gz
ChangeLogTag: Wed Nov 28 09:58:08 2001 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'examples')
-rw-r--r--examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp10
-rw-r--r--examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp12
-rw-r--r--examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp22
-rw-r--r--examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp18
-rw-r--r--examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp14
-rw-r--r--examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp16
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp22
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp26
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp34
-rw-r--r--examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp22
10 files changed, 98 insertions, 98 deletions
diff --git a/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp
index cec2daa0dd7..8d8c0b15e19 100644
--- a/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp
@@ -11,12 +11,12 @@
ACE_RCSID(client, broadcast_client_test, "$Id$")
/* Name of the program. */
-static char *program_name;
+static ACE_TCHAR *program_name;
/* Port number to use. */
static unsigned short broadcast_port_number = ACE_DEFAULT_BROADCAST_PORT;
-static void
+static void
print_usage_and_die (void)
{
ACE_OS::fprintf (stderr, "usage: %s [-p broadcast portnum]\n",
@@ -25,9 +25,9 @@ print_usage_and_die (void)
}
void
-parse_args (int argc, char *argv[])
+parse_args (int argc, ACE_TCHAR *argv[])
{
- ACE_Get_Opt get_opt (argc, argv, "p:");
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("p:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
@@ -42,7 +42,7 @@ parse_args (int argc, char *argv[])
}
int
-main (int argc, char *argv[])
+main (int argc, ACE_TCHAR *argv[])
{
program_name = argv[0];
parse_args (argc, argv);
diff --git a/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp
index c1810bf57a0..9e8aeef81ef 100644
--- a/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp
@@ -1,6 +1,6 @@
// $Id$
-// Tests out the UNIX domain IPC-SAP abstraction.
+// Tests out the UNIX domain IPC-SAP abstraction.
#include "ace/LSOCK_CODgram.h"
#include "ace/LSOCK_Dgram.h"
@@ -20,10 +20,10 @@ static const char *rendezvous_dgram = "/tmp/foo_dgram";
// Name of file to send.
static const char *file_name = "local_data";
-static void
+static void
print_usage_and_die (void)
{
- ACE_ERROR ((LM_ERROR,
+ ACE_ERROR ((LM_ERROR,
"usage: %s [-r rendezvous_dgram] [-c rendezvous_codgram] [-f file]\n",
program_name));
ACE_OS::exit (1);
@@ -53,7 +53,7 @@ parse_args (int argc, char *argv[])
}
int
-main (int argc, char *argv[])
+main (int argc, ACE_TCHAR *argv[])
{
program_name = argv[0];
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
"%p\n",
"open"),
-1);
-
+
// Send the open file descriptor to the server!
if (sc.send_handle (handle) == -1)
@@ -113,7 +113,7 @@ main (int argc, char *argv[])
return 0;
}
#else
-int main (int, char *[])
+int main (int, ACE_TCHAR *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
"your platform must support sendmsg/recvmsg to run this test\n"),
diff --git a/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp
index 67460ae6712..03418e46d80 100644
--- a/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp
@@ -11,32 +11,32 @@
ACE_RCSID(client, local_fifo_client_test, "$Id$")
// Name of the program.
-static char *program_name;
+static ACE_TCHAR *program_name;
// debug state on or off
static int debug = 0;
-static const char *rendezvous_fifo = "/tmp/foo_fifo";
+static const ACE_TCHAR *rendezvous_fifo = ACE_TEXT("/tmp/foo_fifo");
-// Name of file to send.
-static const char *file_name = "./local_data";
+// Name of file to send.
+static const ACE_TCHAR *file_name = ACE_TEXT("./local_data");
-static void
+static void
print_usage_and_die (void)
{
- ACE_ERROR ((LM_ERROR,
+ ACE_ERROR ((LM_ERROR,
"usage: %s [-d] [-f rendezvous_fifo]\n",
program_name));
ACE_OS::exit (1);
}
static void
-parse_arguments (int argc, char *argv[])
+parse_arguments (int argc, ACE_TCHAR *argv[])
{
int tracing = 1;
program_name = argv[0];
- ACE_Get_Opt get_opt (argc, argv, "df:");
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("df:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
@@ -61,13 +61,13 @@ parse_arguments (int argc, char *argv[])
}
int
-main(int argc, char *argv[])
+main(int argc, ACE_TCHAR *argv[])
{
parse_arguments (argc, argv);
ACE_FIFO_Send_Msg fifo;
- if (fifo.open ((const char *) rendezvous_fifo,
+ if (fifo.open (rendezvous_fifo,
O_WRONLY,
0666) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -83,7 +83,7 @@ main(int argc, char *argv[])
"%p\n",
"mmap"),
-1);
-
+
// Next, send the file's contents.
ACE_Str_Buf msg (cp,
diff --git a/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp
index 600bc09c5a8..607bc81ea3a 100644
--- a/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp
@@ -11,16 +11,16 @@
ACE_RCSID(client, local_pipe_client_test, "$Id$")
#if defined (ACE_HAS_MSG) && !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS)
-// Name of the program.
+// Name of the program.
static char *program_name;
-// Name of rendezvous point.
+// Name of rendezvous point.
static const char *rendezvous = "/tmp/foo_pipe";
-// Name of file to send.
+// Name of file to send.
static const char *file_name = "local_data";
-static void
+static void
print_usage_and_die (void)
{
ACE_ERROR ((LM_ERROR,
@@ -99,8 +99,8 @@ do_client_processing (ACE_LSOCK_Stream &sc)
return -1;
}
- if (ACE_OS::close (fd_read[0]) == -1
- || ACE_OS::close (fd_write[1]) == -1
+ if (ACE_OS::close (fd_read[0]) == -1
+ || ACE_OS::close (fd_write[1]) == -1
|| ACE_OS::close (fd1) == -1)
ACE_OS::exit (1);
@@ -108,7 +108,7 @@ do_client_processing (ACE_LSOCK_Stream &sc)
}
int
-main (int argc, char *argv[])
+main (int argc, ACE_TCHAR *argv[])
{
parse_args (argc, argv);
@@ -133,11 +133,11 @@ main (int argc, char *argv[])
"%p\n",
"close"),
-1);
-
+
return 0;
}
#else
-int main (int, char *[])
+int main (int, ACE_TCHAR *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
"your platform must support sendmsg/recvmsg to run this test\n"),
diff --git a/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp
index 711b1fdd581..be6a6d6be27 100644
--- a/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp
@@ -22,7 +22,7 @@ static const char *rendezvous_spipe = "/tmp/foo_spipe";
// Name of file to send.
static const char *file_name = "./local_data";
-static void
+static void
print_usage_and_die (void)
{
ACE_ERROR ((LM_ERROR,
@@ -52,12 +52,12 @@ parse_arguments (int argc, char *argv[])
}
if (debug)
ACE_DEBUG ((LM_DEBUG,
- "rendezvous_spipe = %s\n",
+ "rendezvous_spipe = %s\n",
rendezvous_spipe));
}
int
-main(int argc, char *argv[])
+main(int argc, ACE_TCHAR *argv[])
{
parse_arguments (argc, argv);
@@ -66,7 +66,7 @@ main(int argc, char *argv[])
if (con.connect (spipe,
ACE_SPIPE_Addr (rendezvous_spipe)) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open %s for requesting a new communication channel"
" in local_spipe_client_test.\n",
rendezvous_spipe),
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
"%p\n",
"mmap"),
-1);
-
+
// Next, send the file's contents.
ACE_Str_Buf msg (cp, int (mmap.size ()));
@@ -94,8 +94,8 @@ main(int argc, char *argv[])
}
#else
#include <stdio.h>
-int
-main (int, char *[])
+int
+main (int, ACE_TCHAR *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
"This feature is not supported\n"),
diff --git a/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp
index 764ba8d1d5e..28a51b26509 100644
--- a/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp
@@ -9,16 +9,16 @@
ACE_RCSID(client, local_stream_client_test, "$Id$")
#if defined (ACE_HAS_MSG) && !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS)
-// Name of the program.
+// Name of the program.
static char *program_name;
-// Name of rendezvous point.
+// Name of rendezvous point.
static const char *rendezvous = "/tmp/foo_stream";
-// Name of file to send.
+// Name of file to send.
static const char *file_name = "local_data";
-static void
+static void
print_usage_and_die (void)
{
ACE_ERROR ((LM_ERROR,
@@ -49,7 +49,7 @@ parse_args (int argc, char *argv[])
}
int
-main (int argc, char *argv[])
+main (int argc, ACE_TCHAR *argv[])
{
parse_args (argc, argv);
@@ -74,14 +74,14 @@ main (int argc, char *argv[])
"open"),
-1);
- // Send the open file descriptor to the server!
+ // Send the open file descriptor to the server!
if (sc.send_handle (fd) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"send_handle"),
-1);
-
+
if ((n = sc.recv_n (buf,
sizeof buf)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -100,7 +100,7 @@ main (int argc, char *argv[])
return 0;
}
#else
-int main (int, char *[])
+int main (int, ACE_TCHAR *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
"your platform must support sendmsg/recvmsg to run this test\n"),
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp
index efa28f3ec98..739c87f6be0 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp
@@ -10,17 +10,17 @@
ACE_RCSID(client, remote_dgram_client_test, "$Id$")
-// Name of the program.
-static const char *program_name;
+// Name of the program.
+static const ACE_TCHAR *program_name;
// Port number to use.
static u_short port_number = ACE_DEFAULT_SERVER_PORT;
-// Name of remote host.
-static const char *host_name = ACE_DEFAULT_SERVER_HOST;
+// Name of remote host.
+static const ACE_TCHAR *host_name = ACE_DEFAULT_SERVER_HOST;
-// Name of file to send.
-static const char *file_name = "./remote_data";
+// Name of file to send.
+static const ACE_TCHAR *file_name = ACE_TEXT("./remote_data");
static void print_usage_and_die (void)
{
@@ -31,11 +31,11 @@ static void print_usage_and_die (void)
}
void
-parse_args (int argc, char *argv[])
+parse_args (int argc, ACE_TCHAR *argv[])
{
program_name = argv[0];
- ACE_Get_Opt get_opt (argc, argv, "f:h:p:");
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("f:h:p:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
@@ -56,7 +56,7 @@ parse_args (int argc, char *argv[])
}
int
-main (int argc, char *argv[])
+main (int argc, ACE_TCHAR *argv[])
{
parse_args (argc, argv);
@@ -71,7 +71,7 @@ main (int argc, char *argv[])
"%p\n",
"mmap"),
-1);
-
+
// Next, send the file's contents.
ssize_t cc = sd.send (cp, mmap.size (), sa);
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
-1);
else if (cc != (ssize_t) mmap.size ())
ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
+ "%p\n",
"Not all the contents of mmap file are sent."),
-1);
return 0;
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp
index 9aaf18995b1..cb2652b1f9c 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp
@@ -9,16 +9,16 @@
ACE_RCSID(client, remote_service_directory_test, "$Id$")
-// Port number to use.
+// Port number to use.
static unsigned short port_number = ACE_DEFAULT_SERVICE_PORT;
-// Name of remote host.
-static const char *host_name = ACE_DEFAULT_SERVER_HOST;
+// Name of remote host.
+static const ACE_TCHAR *host_name = ACE_DEFAULT_SERVER_HOST;
// Trigger a remote reconfiguration.
static int remote_reconfigure = 0;
-static void
+static void
print_usage_and_die (void)
{
ACE_ERROR ((LM_ERROR,
@@ -27,9 +27,9 @@ print_usage_and_die (void)
}
void
-parse_args (int argc, char *argv[])
+parse_args (int argc, ACE_TCHAR *argv[])
{
- ACE_Get_Opt get_opt (argc, argv, "p:h:r");
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("p:h:r"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
@@ -49,9 +49,9 @@ parse_args (int argc, char *argv[])
}
}
-int
-main (int argc, char *argv[])
-{
+int
+main (int argc, ACE_TCHAR *argv[])
+{
ACE_LOG_MSG->open (argv[0]);
parse_args (argc, argv);
@@ -64,7 +64,7 @@ main (int argc, char *argv[])
if (con.connect (sc,
ACE_INET_Addr (port_number,
host_name)) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"%p\n%a",
"connect",
1),
@@ -76,7 +76,7 @@ main (int argc, char *argv[])
// Send the command.
- if (sc.send_n (buf,
+ if (sc.send_n (buf,
ACE_OS::strlen (buf) + 1) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n%a",
@@ -95,13 +95,13 @@ main (int argc, char *argv[])
"write",
1),
-1);
-
+
if (sc.close () == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n%a",
"close",
1),
-1);
-
+
return 0;
}
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp
index d5c91b394a6..ba81947b315 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp
@@ -11,19 +11,19 @@
ACE_RCSID(client, remote_stream_client_test, "$Id$")
-// Name of the program.
-static const char *program_name;
+// Name of the program.
+static const ACE_TCHAR *program_name;
-// Port number to use.
+// Port number to use.
static u_short port_number = ACE_DEFAULT_SERVER_PORT;
-// Name of remote host.
-static const char *host_name = ACE_DEFAULT_SERVER_HOST;
+// Name of remote host.
+static const ACE_TCHAR *host_name = ACE_DEFAULT_SERVER_HOST;
-// Name of file to send.
-static const char *file_name = "./remote_data";
+// Name of file to send.
+static const ACE_TCHAR *file_name = ACE_TEXT("./remote_data");
-static void
+static void
print_usage_and_die (void)
{
ACE_ERROR ((LM_ERROR,
@@ -33,10 +33,10 @@ print_usage_and_die (void)
}
void
-parse_args (int argc, char *argv[])
+parse_args (int argc, ACE_TCHAR *argv[])
{
program_name = argv[0];
- ACE_Get_Opt get_opt (argc, argv, "f:h:p:");
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("f:h:p:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
@@ -56,9 +56,9 @@ parse_args (int argc, char *argv[])
}
}
-int
-main (int argc, char *argv[])
-{
+int
+main (int argc, ACE_TCHAR *argv[])
+{
parse_args (argc, argv);
ACE_INET_Addr sa (port_number, host_name);
void *cp;
@@ -72,7 +72,7 @@ main (int argc, char *argv[])
"open"),
-1);
- // First send the name of the file as a datagram.
+ // First send the name of the file as a datagram.
iovec iov[2];
@@ -103,7 +103,7 @@ main (int argc, char *argv[])
"%p\n",
"mmap"),
-1);
-
+
// Next, send the file's contents.
if (sc.send_n (cp, mmap.size ()) == -1)
@@ -111,13 +111,13 @@ main (int argc, char *argv[])
"%p\n",
"send_urg"),
-1);
-
+
if (sc.close_writer () == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"close_writer"),
-1);
-
+
if ((n = sc.recv_n (buf, sizeof buf)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
diff --git a/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp
index 4a08d085254..8d5b4575cf4 100644
--- a/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp
@@ -12,16 +12,16 @@ ACE_RCSID(client, remote_thr_stream_client_test, "$Id$")
#if defined (ACE_HAS_TLI)
-// Name of the program.
+// Name of the program.
static const char *program_name;
-// Port number to use.
+// Port number to use.
static u_short port_number = ACE_DEFAULT_THR_PORT;
-// Name of remote host.
+// Name of remote host.
static const char *host_name = ACE_DEFAULT_SERVER_HOST;
-// Name of file to send.
+// Name of file to send.
static const char *file_name = "./remote_data";
static void print_usage_and_die (void)
@@ -56,9 +56,9 @@ parse_args (int argc, char *argv[])
}
}
-int
-main (int argc, char *argv[])
-{
+int
+main (int argc, ACE_TCHAR *argv[])
+{
parse_args (argc, argv);
void *cp;
char buf[BUFSIZ];
@@ -81,7 +81,7 @@ main (int argc, char *argv[])
"mmap"), -1);
- // Next, send the file's contents.
+ // Next, send the file's contents.
if (sc.send_n (cp, mmap.size ()) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -94,7 +94,7 @@ main (int argc, char *argv[])
"%p\n",
"close_writer"),
-1);
-
+
for (int n; (n = sc.recv (buf, sizeof buf)) > 0; )
if (ACE_OS::write (ACE_STDOUT, buf, n) != n)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -110,8 +110,8 @@ main (int argc, char *argv[])
return 0;
}
#else
-int
-main (int, char *[])
+int
+main (int, ACE_TCHAR *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
"you must have TLI to run this test\n"),