From 46cee8c01a1ecfb7a942e7a6a8f8b65cbe352891 Mon Sep 17 00:00:00 2001 From: brunsch Date: Sun, 9 Jul 2000 21:01:12 +0000 Subject: ChangeLogTag:Sun Jul 09 14:00:34 2000 Darrell Brunsch --- ChangeLog | 53 ++ ChangeLogs/ChangeLog-02a | 53 ++ ChangeLogs/ChangeLog-03a | 53 ++ ace/ace_wchar.h | 4 + ace/adapter/README | 54 ++ ace/adapter/ace/ACE.h | 130 +++++ ace/adapter/ace/ARGV.h | 35 ++ ace/adapter/ace/ATM_Addr.h | 69 +++ ace/adapter/ace/Arg_Shifter.h | 30 ++ ace/adapter/ace/Capabilities.h | 33 ++ ace/adapter/ace/DEV_Addr.h | 55 ++ ace/adapter/ace/DLL.h | 39 ++ ace/adapter/ace/Dirent.h | 21 + ace/adapter/ace/Dynamic_Service.h | 18 + ace/adapter/ace/FIFO.h | 40 ++ ace/adapter/ace/FIFO_Recv.h | 32 ++ ace/adapter/ace/FIFO_Recv_Msg.h | 33 ++ ace/adapter/ace/FIFO_Send.h | 31 ++ ace/adapter/ace/FIFO_Send_Msg.h | 34 ++ ace/adapter/ace/FILE_Addr.h | 57 +++ ace/adapter/ace/Functor.h | 77 +++ ace/adapter/ace/High_Res_Timer.h | 37 ++ ace/adapter/ace/INET_Addr.h | 117 +++++ ace/adapter/ace/MEM_Addr.h | 80 +++ ace/adapter/ace/Malloc_T.h | 90 ++++ ace/adapter/ace/Memory_Pool.h | 90 ++++ ace/adapter/ace/OS.h | 912 +++++++++++++++++++++++++++++++++ ace/adapter/ace/OS_Dirent.h | 17 + ace/adapter/ace/OS_String.h | 44 ++ ace/adapter/ace/SOCK_Dgram_Bcast.h | 35 ++ ace/adapter/ace/SOCK_Dgram_Mcast.h | 45 ++ ace/adapter/ace/SOCK_Dgram_Mcast_QoS.h | 49 ++ ace/adapter/ace/SPIPE_Addr.h | 56 ++ ace/adapter/ace/Service_Config.h | 87 ++++ ace/adapter/ace/Service_Object.h | 30 ++ ace/adapter/ace/Stats.h | 20 + ace/adapter/ace/System_Time.h | 21 + ace/adapter/ace/Task_T.h | 25 + ace/adapter/ace/Trace.h | 24 + 39 files changed, 2730 insertions(+) create mode 100644 ace/adapter/README create mode 100644 ace/adapter/ace/ACE.h create mode 100644 ace/adapter/ace/ARGV.h create mode 100644 ace/adapter/ace/ATM_Addr.h create mode 100644 ace/adapter/ace/Arg_Shifter.h create mode 100644 ace/adapter/ace/Capabilities.h create mode 100644 ace/adapter/ace/DEV_Addr.h create mode 100644 ace/adapter/ace/DLL.h create mode 100644 ace/adapter/ace/Dirent.h create mode 100644 ace/adapter/ace/Dynamic_Service.h create mode 100644 ace/adapter/ace/FIFO.h create mode 100644 ace/adapter/ace/FIFO_Recv.h create mode 100644 ace/adapter/ace/FIFO_Recv_Msg.h create mode 100644 ace/adapter/ace/FIFO_Send.h create mode 100644 ace/adapter/ace/FIFO_Send_Msg.h create mode 100644 ace/adapter/ace/FILE_Addr.h create mode 100644 ace/adapter/ace/Functor.h create mode 100644 ace/adapter/ace/High_Res_Timer.h create mode 100644 ace/adapter/ace/INET_Addr.h create mode 100644 ace/adapter/ace/MEM_Addr.h create mode 100644 ace/adapter/ace/Malloc_T.h create mode 100644 ace/adapter/ace/Memory_Pool.h create mode 100644 ace/adapter/ace/OS.h create mode 100644 ace/adapter/ace/OS_Dirent.h create mode 100644 ace/adapter/ace/OS_String.h create mode 100644 ace/adapter/ace/SOCK_Dgram_Bcast.h create mode 100644 ace/adapter/ace/SOCK_Dgram_Mcast.h create mode 100644 ace/adapter/ace/SOCK_Dgram_Mcast_QoS.h create mode 100644 ace/adapter/ace/SPIPE_Addr.h create mode 100644 ace/adapter/ace/Service_Config.h create mode 100644 ace/adapter/ace/Service_Object.h create mode 100644 ace/adapter/ace/Stats.h create mode 100644 ace/adapter/ace/System_Time.h create mode 100644 ace/adapter/ace/Task_T.h create mode 100644 ace/adapter/ace/Trace.h diff --git a/ChangeLog b/ChangeLog index 89802b455bb..69902781294 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,56 @@ +Sun Jul 09 14:00:34 2000 Darrell Brunsch + + * ace/ace_wchar.h: + + Added two macros for straight out conversion of strings: + ACE_TEXT_CHAR_TO_WCHAR and ACE_TEXT_WCHAR_TO_CHAR. + + * ace/adapter/README + * ace/adapter/ace/ACE.h + * ace/adapter/ace/ARGV.h + * ace/adapter/ace/Arg_Shifter.h + * ace/adapter/ace/ATM_Addr.h + * ace/adapter/ace/DEV_Addr.h + * ace/adapter/ace/Dirent.h + * ace/adapter/ace/DLL.h + * ace/adapter/ace/Dynamic_Service.h + * ace/adapter/ace/FIFO.h + * ace/adapter/ace/FIFO_Recv.h + * ace/adapter/ace/FIFO_Recv_Msg.h + * ace/adapter/ace/FIFO_Send.h + * ace/adapter/ace/FIFO_Send_Msg.h + * ace/adapter/ace/FILE_Addr.h + * ace/adapter/ace/Functor.h + * ace/adapter/ace/High_Res_Timer.h + * ace/adapter/ace/INET_Addr.h + * ace/adapter/ace/Malloc_T.h + * ace/adapter/ace/Memory_Pool.h + * ace/adapter/ace/MEM_Addr.h + * ace/adapter/ace/OS_Dirent.h + * ace/adapter/ace/OS_String.h + * ace/adapter/ace/Service_Config.h + * ace/adapter/ace/Service_Object.h + * ace/adapter/ace/SOCK_Dgram_Bcast.h + * ace/adapter/ace/SOCK_Dgram_Mcast.h + * ace/adapter/ace/SPIPE_Addr.h + * ace/adapter/ace/System_Time.h + * ace/adapter/ace/Task_T.h + * ace/adapter/ace/Trace.h + + This is a initial shot at the implementation of an adaptation + layer for ACE that provides a Wide character interface with + a character library and vice versa. + + Right now the above files contain classes ending with _W that + correspond to the actual classes (such as ACE_W). This class + will have methods that take in wchar_t instead of char, and + then convert the parameters and return value when calling + the actual char implementation. + + Note, this is an initial implementation that isn't complete + across all interfaces and there are memory managment issues that + still must be dealt with. + Sat Jul 08 14:50:34 2000 David L. Levine * all Makefiles: updated dependencies. diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 89802b455bb..69902781294 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,56 @@ +Sun Jul 09 14:00:34 2000 Darrell Brunsch + + * ace/ace_wchar.h: + + Added two macros for straight out conversion of strings: + ACE_TEXT_CHAR_TO_WCHAR and ACE_TEXT_WCHAR_TO_CHAR. + + * ace/adapter/README + * ace/adapter/ace/ACE.h + * ace/adapter/ace/ARGV.h + * ace/adapter/ace/Arg_Shifter.h + * ace/adapter/ace/ATM_Addr.h + * ace/adapter/ace/DEV_Addr.h + * ace/adapter/ace/Dirent.h + * ace/adapter/ace/DLL.h + * ace/adapter/ace/Dynamic_Service.h + * ace/adapter/ace/FIFO.h + * ace/adapter/ace/FIFO_Recv.h + * ace/adapter/ace/FIFO_Recv_Msg.h + * ace/adapter/ace/FIFO_Send.h + * ace/adapter/ace/FIFO_Send_Msg.h + * ace/adapter/ace/FILE_Addr.h + * ace/adapter/ace/Functor.h + * ace/adapter/ace/High_Res_Timer.h + * ace/adapter/ace/INET_Addr.h + * ace/adapter/ace/Malloc_T.h + * ace/adapter/ace/Memory_Pool.h + * ace/adapter/ace/MEM_Addr.h + * ace/adapter/ace/OS_Dirent.h + * ace/adapter/ace/OS_String.h + * ace/adapter/ace/Service_Config.h + * ace/adapter/ace/Service_Object.h + * ace/adapter/ace/SOCK_Dgram_Bcast.h + * ace/adapter/ace/SOCK_Dgram_Mcast.h + * ace/adapter/ace/SPIPE_Addr.h + * ace/adapter/ace/System_Time.h + * ace/adapter/ace/Task_T.h + * ace/adapter/ace/Trace.h + + This is a initial shot at the implementation of an adaptation + layer for ACE that provides a Wide character interface with + a character library and vice versa. + + Right now the above files contain classes ending with _W that + correspond to the actual classes (such as ACE_W). This class + will have methods that take in wchar_t instead of char, and + then convert the parameters and return value when calling + the actual char implementation. + + Note, this is an initial implementation that isn't complete + across all interfaces and there are memory managment issues that + still must be dealt with. + Sat Jul 08 14:50:34 2000 David L. Levine * all Makefiles: updated dependencies. diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 89802b455bb..69902781294 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,56 @@ +Sun Jul 09 14:00:34 2000 Darrell Brunsch + + * ace/ace_wchar.h: + + Added two macros for straight out conversion of strings: + ACE_TEXT_CHAR_TO_WCHAR and ACE_TEXT_WCHAR_TO_CHAR. + + * ace/adapter/README + * ace/adapter/ace/ACE.h + * ace/adapter/ace/ARGV.h + * ace/adapter/ace/Arg_Shifter.h + * ace/adapter/ace/ATM_Addr.h + * ace/adapter/ace/DEV_Addr.h + * ace/adapter/ace/Dirent.h + * ace/adapter/ace/DLL.h + * ace/adapter/ace/Dynamic_Service.h + * ace/adapter/ace/FIFO.h + * ace/adapter/ace/FIFO_Recv.h + * ace/adapter/ace/FIFO_Recv_Msg.h + * ace/adapter/ace/FIFO_Send.h + * ace/adapter/ace/FIFO_Send_Msg.h + * ace/adapter/ace/FILE_Addr.h + * ace/adapter/ace/Functor.h + * ace/adapter/ace/High_Res_Timer.h + * ace/adapter/ace/INET_Addr.h + * ace/adapter/ace/Malloc_T.h + * ace/adapter/ace/Memory_Pool.h + * ace/adapter/ace/MEM_Addr.h + * ace/adapter/ace/OS_Dirent.h + * ace/adapter/ace/OS_String.h + * ace/adapter/ace/Service_Config.h + * ace/adapter/ace/Service_Object.h + * ace/adapter/ace/SOCK_Dgram_Bcast.h + * ace/adapter/ace/SOCK_Dgram_Mcast.h + * ace/adapter/ace/SPIPE_Addr.h + * ace/adapter/ace/System_Time.h + * ace/adapter/ace/Task_T.h + * ace/adapter/ace/Trace.h + + This is a initial shot at the implementation of an adaptation + layer for ACE that provides a Wide character interface with + a character library and vice versa. + + Right now the above files contain classes ending with _W that + correspond to the actual classes (such as ACE_W). This class + will have methods that take in wchar_t instead of char, and + then convert the parameters and return value when calling + the actual char implementation. + + Note, this is an initial implementation that isn't complete + across all interfaces and there are memory managment issues that + still must be dealt with. + Sat Jul 08 14:50:34 2000 David L. Levine * all Makefiles: updated dependencies. diff --git a/ace/ace_wchar.h b/ace/ace_wchar.h index 7aecda6e13a..9c8fc06de0a 100644 --- a/ace/ace_wchar.h +++ b/ace/ace_wchar.h @@ -78,6 +78,10 @@ typedef char TCHAR; // Define the unicode/wchar related macros correctly +#if defined ACE_HAS_WCHAR +# define ACE_TEXT_CHAR_TO_WCHAR(STRING) ACE_Ascii_To_Wide (STRING).wchar_rep () +# define ACE_TEXT_WCHAR_TO_CHAR(STRING) ACE_Wide_To_Ascii (STRING).char_rep () +#endif /* ACE_HAS_WCHAR */ #if defined (ACE_USES_WCHAR) typedef wchar_t ACE_TCHAR; diff --git a/ace/adapter/README b/ace/adapter/README new file mode 100644 index 00000000000..122ad26007a --- /dev/null +++ b/ace/adapter/README @@ -0,0 +1,54 @@ +The ACE Adapter is a set of header files which just provide an adaptation +layer above ACE which presents a Wide Character interface for all ACE_TCHAR +instances if ACE_USES_WCHAR is not defined, and vice versa. + +This is just an initial implemention and has only been partially tested. +There are many known problems with it, especially with memory management. +Only the Unicode versions currently exist. The character versions will +be added later. + +TODO: These files have ACE_TCHAR but do not have adapters yet. + +\ace\Acceptor.h +\ace\Configuration.h +\ace\Connector.h +\ace\Env_Value_T.h +\ace\Filecache.h +\ace\Get_Opt.h +\ace\Local_Name_Space_T.h +\ace\Local_Tokens.h +\ace\Log_Msg.h +\ace\Log_Record.h +\ace\MEM_Acceptor.h +\ace\Mem_Map.h +\ace\MEM_SAP.h +\ace\Module.h +\ace\Naming_Context.h +\ace\NT_Service.h +\ace\Obstack.h +\ace\Parse_Node.h +\ace\Remote_Name_Space.h +\ace\Remote_Tokens.h +\ace\Service_Manager.h +\ace\Service_Repository.h +\ace\Service_Types.h +\ace\Shared_Memory_MM.h +\ace\Shared_Object.h +\ace\SString.h +\ace\Stream.h +\ace\Stream_Modules.h +\ace\Svc_Conf.h +\ace\Svc_Handler.h +\ace\Synch.h +\ace\Synch_T.h +\ace\Task_T.h +\ace\Token.h +\ace\Token_Collection.h +\ace\Token_Invariants.h +\ace\Token_Manager.h +\ace\Token_Request_Reply.h + +Difficult + +\ace\Process.h +\ace\Registry.h diff --git a/ace/adapter/ace/ACE.h b/ace/adapter/ace/ACE.h new file mode 100644 index 00000000000..bafc438ff8f --- /dev/null +++ b/ace/adapter/ace/ACE.h @@ -0,0 +1,130 @@ +// $Id$ + +#ifndef ACE_ADAPTER_ACE_H +#define ACE_ADAPTER_ACE_H +#include "ace/pre.h" + +#include "../../ACE.h" + +class ACE_W : public ACE +{ +public: + // @@ Memory Leaks? + static const wchar_t *compiler_name (void) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE::compiler_name ())); } + + static int get_bcast_addr (ACE_UINT32 &bcast_addr, + const wchar_t *hostname = 0, + ACE_UINT32 host_addr = 0, + ACE_HANDLE handle = ACE_INVALID_HANDLE) + { return ACE::get_bcast_addr (bcast_addr, ACE_TEXT_WCHAR_TO_CHAR (hostname), host_addr, handle); } + + static ACE_HANDLE handle_timed_open (ACE_Time_Value *timeout, const wchar_t *name, int flags, int perms) + { return ACE::handle_timed_open (timeout, ACE_TEXT_WCHAR_TO_CHAR (name), flags, perms); } + + +#if !defined (ACE_HAS_WINCE) + static wchar_t *strenvdup (const wchar_t *str) + { return ACE_OS::strdup (ACE_TEXT_CHAR_TO_WCHAR (ACE::strenvdup (ACE_TEXT_WCHAR_TO_CHAR (str)))); } +#endif /* ACE_HAS_WINCE */ + + static const wchar_t *execname (const wchar_t *pathname) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE::execname (ACE_TEXT_WCHAR_TO_CHAR (pathname)))); } + + static const wchar_t *basename (const wchar_t *pathname, wchar_t delim = ACE_DIRECTORY_SEPARATOR_CHAR) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE::basename (ACE_TEXT_WCHAR_TO_CHAR (pathname), delim))); } + + static const wchar_t *dirname (const wchar_t *pathname, wchar_t delim = ACE_DIRECTORY_SEPARATOR_CHAR) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE::dirname (ACE_TEXT_WCHAR_TO_CHAR (pathname), delim))); } + + static wchar_t *timestamp (wchar_t date_and_time[], int time_len) + { + char *result; + char *char_buf; + ACE_NEW_RETURN (char_buf, char[time_len], 0); + + result = ACE::timestamp (char_buf, time_len); + ACE_OS::strcpy (date_and_time, ACE_TEXT_CHAR_TO_WCHAR (char_buf)); + delete [] char_buf; + + if (result == 0) + return 0; + + // @@ Don't think this is actually the same behavior + return date_and_time; + } + + static pid_t fork (const wchar_t *program_name = L"", int avoid_zombies = 0) + { return ACE::fork (ACE_TEXT_WCHAR_TO_CHAR (program_name), avoid_zombies); } + + static int daemonize (const wchar_t pathname[] = L"/", + int close_all_handles = ACE_DEFAULT_CLOSE_ALL_HANDLES, + const wchar_t program_name[] = L"") + { return ACE::daemonize (ACE_TEXT_WCHAR_TO_CHAR (pathname), + close_all_handles, + ACE_TEXT_WCHAR_TO_CHAR (program_name)); } + + static int ldfind (const wchar_t *filename, wchar_t *pathname, size_t maxlen) + { + int result; + char *char_buf; + ACE_NEW_RETURN (char_buf, char[maxlen], 0); + + result = ACE::ldfind (ACE_TEXT_WCHAR_TO_CHAR (filename), char_buf, maxlen); + ACE_OS::strcpy (pathname, ACE_TEXT_CHAR_TO_WCHAR (char_buf)); + delete [] char_buf; + return result; + } + + static FILE *ldopen (const wchar_t *filename, const wchar_t *type) + { return ACE::ldopen (ACE_TEXT_WCHAR_TO_CHAR (filename), ACE_TEXT_WCHAR_TO_CHAR (type)); } + + static int get_temp_dir (wchar_t *buffer, size_t buffer_len) + { + int result; + char *char_buf; + ACE_NEW_RETURN (char_buf, char [buffer_len], -1); + + result = ACE::get_temp_dir (char_buf, buffer_len); + ACE_OS::strcpy (buffer, ACE_TEXT_CHAR_TO_WCHAR (char_buf)); + delete [] char_buf; + return result; + } + + static ACE_HANDLE open_temp_file (const wchar_t *name, int mode, int perm = 0) + { return ACE::open_temp_file (ACE_TEXT_WCHAR_TO_CHAR (name), mode, perm); } + + static int format_hexdump (const char *buffer, int size, wchar_t *obuf, int obuf_sz) + { + int result; + char *char_buf; + ACE_NEW_RETURN (char_buf, char [obuf_sz], -1); + + result = ACE::format_hexdump (buffer, size, char_buf, obuf_sz); + ACE_OS::strcpy (obuf, ACE_TEXT_CHAR_TO_WCHAR (char_buf)); + delete [] char_buf; + return result; + } + + static const wchar_t *sock_error (int error) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE::sock_error (error))); } + + static void unique_name (const void *object, wchar_t *name, size_t length) + { + char *char_buf; + ACE_NEW (char_buf, char [length]); + + ACE::unique_name (object, char_buf, length); + ACE_OS::strcpy (name, ACE_TEXT_CHAR_TO_WCHAR (char_buf)); + delete [] char_buf; + } + + static wchar_t nibble2hex (u_int n) + { return ACE::nibble2hex (n); } + + static u_char hex2byte (wchar_t c) + { return ACE::hex2byte (c); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_ACE_H */ diff --git a/ace/adapter/ace/ARGV.h b/ace/adapter/ace/ARGV.h new file mode 100644 index 00000000000..487c4031360 --- /dev/null +++ b/ace/adapter/ace/ARGV.h @@ -0,0 +1,35 @@ +// $Id$ + +#ifndef ACE_ADAPTER_ARGV_H +#define ACE_ADAPTER_ARGV_H +#include "ace/pre.h" + +#include "../../ARGV.h" + +class ACE_ARGV_W : public ACE_ARGV +{ +public: + ACE_ARGV_W (const wchar_t buf[], int substitute_env_args = 1) + : ACE_ARGV (ACE_TEXT_WCHAR_TO_CHAR (buf), substitute_env_args) {} + + // @@ Implement: ACE_ARGV_W (wchar_t *argv[], int substitute_env_args = 1) + + // @@ Implement: ACE_ARGV_W (wchar_t *first_argv[], wchar_t *second_argv[], int substitute_env_args =1) + + ~ACE_ARGV_W (void) {} + + const wchar_t *operator[] (size_t index) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_ARGV::operator[] (index))); } + + // @@ Implement: wchar_t **argv (void); + + // @@ Implement: const wchar_t *buf (void); + + int add (const wchar_t *next_arg) + { return ACE_ARGV::add (ACE_TEXT_WCHAR_TO_CHAR (next_arg)); }; + + // @@ Implement: int add (wchar_t *argv[]); +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_ARGV_H */ diff --git a/ace/adapter/ace/ATM_Addr.h b/ace/adapter/ace/ATM_Addr.h new file mode 100644 index 00000000000..582cc935882 --- /dev/null +++ b/ace/adapter/ace/ATM_Addr.h @@ -0,0 +1,69 @@ +// $Id$ + +#ifndef ACE_ADAPTER_ATM_ADDR_H +#define ACE_ADAPTER_ATM_ADDR_H +#include "ace/pre.h" + +#include "../../ATM_Addr.h" + +class ACE_ATM_Addr_W : public ACE_ATM_Addr +{ +public: + ACE_ATM_Addr_W (unsigned char selector = DEFAULT_SELECTOR) + : ACE_ATM_Addr (selector) + {} + + ACE_ATM_Addr_W (const ACE_ATM_Addr_W &addr, + unsigned char selector = DEFAULT_SELECTOR) + : ACE_ATM_Addr (addr, selector) + {} + + ACE_ATM_Addr_W (const ATM_Addr *addr, + unsigned char selector = DEFAULT_SELECTOR) + : ACE_ATM_Addr (addr, selector) + {} + + ACE_ATM_Addr_W (const wchar_t sap[], + unsigned char selector = DEFAULT_SELECTOR) + : ACE_ATM_Addr (ACE_TEXT_WCHAR_TO_CHAR (sap), selector) + {} + + ~ACE_ATM_Addr_W (void) + {} + + int set (const ACE_ATM_Addr_W &addr, + unsigned char selector = DEFAULT_SELECTOR) + { return ACE_ATM_Addr::set (addr, selector); } + + int set (const wchar_t sap[], + unsigned char selector = DEFAULT_SELECTOR) + { return ACE_ATM_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (sap), selector); } + + virtual int string_to_addr (const wchar_t sap[]) + { return ACE_ATM_Addr::string_to_addr (ACE_TEXT_WCHAR_TO_CHAR (sap)); } + + virtual int addr_to_string (wchar_t addr[], + size_t addrlen) const + { + char *caddr; + ACE_NEW_RETURN (caddr, char [addrlen], -1); + + int result = ACE_ATM_Addr::addr_to_string (caddr, addrlen); + ACE_OS::strcpy (addr, ACE_TEXT_CHAR_TO_WCHAR (caddr)); + delete [] caddr; + return result; + } + + const wchar_t *addr_to_string (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_ATM_Addr::addr_to_string ())); } + + int operator == (const ACE_ATM_Addr_W &SAP) const + { return ACE_ATM_Addr::operator== (SAP); } + + int operator != (const ACE_ATM_Addr_W &SAP) const + { return ACE_ATM_Addr::operator!= (SAP); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_ATM_ADDR_H */ + diff --git a/ace/adapter/ace/Arg_Shifter.h b/ace/adapter/ace/Arg_Shifter.h new file mode 100644 index 00000000000..2159c03b9f6 --- /dev/null +++ b/ace/adapter/ace/Arg_Shifter.h @@ -0,0 +1,30 @@ +// $Id$ + +#ifndef ACE_ADAPTER_ARG_SHIFTER_H +#define ACE_ADAPTER_ARG_SHIFTER_H +#include "ace/pre.h" + +#include "ACE.h" +#include "../../Arg_Shifter.h" + + +class ACE_Arg_Shifter_W : public ACE_Arg_Shifter +{ +public: + // @@ Implement ACE_Arg_Shifter_W (int& argc, wchar_t **argv, wchar_t **temp = 0); + + ~ACE_Arg_Shifter_W (void) + {} + + wchar_t *get_current (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_Arg_Shifter::get_current ())); } + + wchar_t *get_the_parameter (const wchar_t* flag) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_Arg_Shifter::get_the_parameter (ACE_TEXT_WCHAR_TO_CHAR (flag)))); } + + int cur_arg_strncasecmp (const wchar_t *flag) + { return ACE_Arg_Shifter::cur_arg_strncasecmp (ACE_TEXT_WCHAR_TO_CHAR (flag)); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_ARG_SHIFTER_H */ diff --git a/ace/adapter/ace/Capabilities.h b/ace/adapter/ace/Capabilities.h new file mode 100644 index 00000000000..2218d1d0074 --- /dev/null +++ b/ace/adapter/ace/Capabilities.h @@ -0,0 +1,33 @@ +// $Id$ +#ifndef ACE_ADAPTER_CAPABILITIES_H +#define ACE_ADAPTER_CAPABILITIES_H +#include "ace/pre.h" + +#include "../../Capabilities.h" + +class ACE_Capabilities_W : public ACE_Capabilities +{ +public: + ACE_Capabilities_W (void) + {} + + ~ACE_Capabilities_W (void) + {} + + int getval (const wchar_t *ent, ACE_WString &val) + { + ACE_CString cstr; + int result = ACE_Capabilities::getval (ACE_TEXT_WCHAR_TO_CHAR (ent), cstr); + val = ACE_WString (cstr.c_str ()); + return result; + } + + int getval (const wchar_t *ent, int &val) + { return ACE_Capabilities::getval (ACE_TEXT_WCHAR_TO_CHAR (ent), val); } + + int getent (const wchar_t *fname, const wchar_t *name) + { return ACE_Capabilities::getent (ACE_TEXT_WCHAR_TO_CHAR (fname), ACE_TEXT_WCHAR_TO_CHAR (name)); } +}; + +#include "ace/post.h" +#endif /* __ACE_ADAPTER_CAPABILITIES_H__ */ diff --git a/ace/adapter/ace/DEV_Addr.h b/ace/adapter/ace/DEV_Addr.h new file mode 100644 index 00000000000..7281c382c07 --- /dev/null +++ b/ace/adapter/ace/DEV_Addr.h @@ -0,0 +1,55 @@ +// $Id$ + +#ifndef ACE_ADAPTER_DEV_ADDR_H +#define ACE_ADAPTER_DEV_ADDR_H +#include "ace/pre.h" + +#include "../../DEV_Addr.h" + +class ACE_DEV_Addr_W : public ACE_DEV_Addr +{ +public: + ACE_DEV_Addr_W (void) + {} + + ACE_DEV_Addr_W (const ACE_DEV_Addr &sa) + : ACE_DEV_Addr (sa) + {} + + ACE_EXPLICIT ACE_DEV_Addr_W (const wchar_t *devname) + : ACE_DEV_Addr (ACE_TEXT_WCHAR_TO_CHAR (devname)) + {} + + void set (const wchar_t *devname) + { ACE_DEV_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (devname)); } + + ACE_DEV_Addr &operator= (const ACE_DEV_Addr &sa) + { + ACE_DEV_Addr::operator= (sa); + return *this; + } + + virtual int addr_to_string (wchar_t *addr, size_t size) const + { + char *caddr; + ACE_NEW_RETURN (caddr, char [size], -1); + + int result = ACE_DEV_Addr::addr_to_string (caddr, size); + + ACE_OS::strcpy (addr, ACE_TEXT_CHAR_TO_WCHAR (caddr)); + delete [] caddr; + return result; + } + + int operator == (const ACE_DEV_Addr &SAP) const + { return ACE_DEV_Addr::operator== (SAP); } + + int operator != (const ACE_DEV_Addr &SAP) const + { return ACE_DEV_Addr::operator!= (SAP); } + + const wchar_t *get_path_name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_DEV_Addr::get_path_name ())); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_DEV_ADDR_H */ diff --git a/ace/adapter/ace/DLL.h b/ace/adapter/ace/DLL.h new file mode 100644 index 00000000000..89aa59367a8 --- /dev/null +++ b/ace/adapter/ace/DLL.h @@ -0,0 +1,39 @@ +// $Id$ + +#ifndef ACE_ADAPTER_DLL_H +#define ACE_ADAPTER_DLL_H +#include "ace/pre.h" + +#include "ace/ACE.h" +#include "../../DLL.h" + +class ACE_DLL_W : public ACE_DLL +{ +public: + ACE_DLL_W (int close_on_destruction = 1) + : ACE_DLL (close_on_destruction) + {} + + ACE_DLL_W (const wchar_t *dll_name, + int open_mode = ACE_DEFAULT_SHLIB_MODE, + int close_on_destruction = 1) + : ACE_DLL (ACE_TEXT_WCHAR_TO_CHAR (dll_name), open_mode, close_on_destruction) + {} + + int open (const wchar_t *dll_name, + int open_mode = ACE_DEFAULT_SHLIB_MODE, + int close_on_destruction = 1) + { return ACE_DLL::open (ACE_TEXT_WCHAR_TO_CHAR (dll_name), open_mode, close_on_destruction); } + + ~ACE_DLL_W (void) + {} + + void *symbol (const wchar_t *symbol_name) + { return ACE_DLL::symbol (ACE_TEXT_WCHAR_TO_CHAR (symbol_name)); } + + wchar_t *error (void) + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_DLL::error ())); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_DLL_H */ diff --git a/ace/adapter/ace/Dirent.h b/ace/adapter/ace/Dirent.h new file mode 100644 index 00000000000..5b164c32baa --- /dev/null +++ b/ace/adapter/ace/Dirent.h @@ -0,0 +1,21 @@ +// $Id$ +#ifndef ACE_ADAPTER_DIRENT_H +#define ACE_ADAPTER_DIRENT_H +#include "ace/pre.h" + +#include "../../Dirent.h" + +class ACE_Dirent_W : public ACE_Dirent +{ +public: + ACE_EXPLICIT ACE_Dirent_W (const wchar_t *dirname) + : ACE_Dirent (ACE_TEXT_WCHAR_TO_CHAR (dirname)) {} + + int open (const wchar_t *filename) + { return ACE_Dirent::open (ACE_TEXT_WCHAR_TO_CHAR (filename)); }; + + ~ACE_Dirent_W (void) {} +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_DIRENT_H */ diff --git a/ace/adapter/ace/Dynamic_Service.h b/ace/adapter/ace/Dynamic_Service.h new file mode 100644 index 00000000000..f32fc2224c3 --- /dev/null +++ b/ace/adapter/ace/Dynamic_Service.h @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef ACE_ADAPTER_DYNAMIC_SERVICE_H +#define ACE_ADAPTER_DYNAMIC_SERVICE_H +#include "ace/pre.h" + +#include "../../Dynamic_Service.h" + +template +class ACE_Dynamic_Service_W : public ACE_Dynamic_Service +{ +public: + static SERVICE *instance (const wchar_t *name) + { return ACE_Dynamic_Service::instance (ACE_TEXT_WCHAR_TO_CHAR (name)); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_DYNAMIC_SERVICE_H */ diff --git a/ace/adapter/ace/FIFO.h b/ace/adapter/ace/FIFO.h new file mode 100644 index 00000000000..5fca19db73d --- /dev/null +++ b/ace/adapter/ace/FIFO.h @@ -0,0 +1,40 @@ +// $Id$ + +#ifndef ACE_ADAPTER_FIFO_H +#define ACE_ADAPTER_FIFO_H +#include "ace/pre.h" + +#include "../../FIFO.h" + +// @@ These probably should be moved into the other ACE_FIFO derived classes + +class ACE_FIFO_W : public ACE_FIFO +{ +public: + int open (const wchar_t *rendezvous, int flags, int perms, + LPSECURITY_ATTRIBUTES sa = 0) + { return ACE_FIFO::open (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, sa); } + + int get_local_addr (const wchar_t *&rendezvous) const + { + char *crend; + int result = ACE_FIFO::get_local_addr (crend); + + rendezvous = ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (crend)); + delete [] crend; + return result; + } + +protected: + ACE_FIFO_W (void) + {} + + ACE_FIFO_W (const wchar_t *rendezvous, int flags, int perms, + LPSECURITY_ATTRIBUTES sa = 0) + : ACE_FIFO (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, sa) + {} + +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_FIFO_H */ diff --git a/ace/adapter/ace/FIFO_Recv.h b/ace/adapter/ace/FIFO_Recv.h new file mode 100644 index 00000000000..d120f004d61 --- /dev/null +++ b/ace/adapter/ace/FIFO_Recv.h @@ -0,0 +1,32 @@ +// $Id$ + +#ifndef ACE_ADAPTER_FIFO_RECV_H +#define ACE_ADAPTER_FIFO_RECV_H +#include "ace/pre.h" + +#include "../../FIFO_Recv.h" + +class ACE_FIFO_Recv_W : public ACE_FIFO_Recv +{ +public: + ACE_FIFO_Recv_W (void) + {} + + ACE_FIFO_Recv_W (const wchar_t *rendezvous, + int flags = O_CREAT | O_RDONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + int persistent = 1, + LPSECURITY_ATTRIBUTES sa = 0) + : ACE_FIFO_Recv (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, persistent, sa) + {} + + int open (const wchar_t *rendezvous, + int flags = O_CREAT | O_RDONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + int persistent = 1, + LPSECURITY_ATTRIBUTES sa = 0) + { return ACE_FIFO_Recv::open (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, persistent, sa); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_FIFO_RECV_H */ diff --git a/ace/adapter/ace/FIFO_Recv_Msg.h b/ace/adapter/ace/FIFO_Recv_Msg.h new file mode 100644 index 00000000000..7f8779f6864 --- /dev/null +++ b/ace/adapter/ace/FIFO_Recv_Msg.h @@ -0,0 +1,33 @@ +// $Id$ + +#ifndef ACE_ADPATER_FIFO_RECV_MSG_H +#define ACE_ADPATER_FIFO_RECV_MSG_H +#include "ace/pre.h" + +#include "../../FIFO_Recv_Msg.h" + +class ACE_FIFO_Recv_Msg_W : public ACE_FIFO_Recv_Msg +{ +public: + ACE_FIFO_Recv_Msg_W (void) + {} + + ACE_FIFO_Recv_Msg_W (const wchar_t *rendezvous, + int flags = O_CREAT | O_RDONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + int persistent = 1, + LPSECURITY_ATTRIBUTES sa = 0) + : ACE_FIFO_Recv_Msg (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, persistent, sa) + {} + + int open (const wchar_t *rendezvous, + int flags = O_CREAT | O_RDONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + int persistent = 1, + LPSECURITY_ATTRIBUTES sa = 0) + { return ACE_FIFO_Recv_Msg::open (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, persistent, sa); } + +}; + +#include "ace/post.h" +#endif /* ACE_ADPATER_FIFO_RECV_MSG_H */ diff --git a/ace/adapter/ace/FIFO_Send.h b/ace/adapter/ace/FIFO_Send.h new file mode 100644 index 00000000000..3e316b0ac08 --- /dev/null +++ b/ace/adapter/ace/FIFO_Send.h @@ -0,0 +1,31 @@ +// $Id$ + +#ifndef ACE_ADAPTER_FIFO_SEND_H +#define ACE_ADAPTER_FIFO_SEND_H +#include "ace/pre.h" + +#include "../../FIFO_Send.h" + +class ACE_FIFO_Send_W : public ACE_FIFO_Send +{ +public: + ACE_FIFO_Send_W (void) + {} + + ACE_FIFO_Send_W (const wchar_t *rendezvous, + int flags = O_WRONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + LPSECURITY_ATTRIBUTES sa = 0) + : ACE_FIFO_Send (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, sa) + {} + + int open (const wchar_t *rendezvous, + int flags = O_WRONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + LPSECURITY_ATTRIBUTES sa = 0) + { return ACE_FIFO_Send::open (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, sa); } + +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_FIFO_SEND_H */ diff --git a/ace/adapter/ace/FIFO_Send_Msg.h b/ace/adapter/ace/FIFO_Send_Msg.h new file mode 100644 index 00000000000..d736a1e4cb3 --- /dev/null +++ b/ace/adapter/ace/FIFO_Send_Msg.h @@ -0,0 +1,34 @@ +// $Id$ + +#ifndef ACE_ADAPTER_FIFO_SEND_MSG_H +#define ACE_ADAPTER_FIFO_SEND_MSG_H +#include "ace/pre.h" + +#include "../../FIFO_Send_Msg.h" + +class ACE_FIFO_Send_Msg_W : public ACE_FIFO_Send_Msg +{ +public: + ACE_FIFO_Send_Msg_W (void) + {} + + ACE_FIFO_Send_Msg_W (const wchar_t *rendezvous, + int flags = O_WRONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + LPSECURITY_ATTRIBUTES sa = 0) + : ACE_FIFO_Send_Msg (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, sa) + {} + + + + int open (const wchar_t *rendezvous, + int flags = O_WRONLY, + int perms = ACE_DEFAULT_FILE_PERMS, + LPSECURITY_ATTRIBUTES sa = 0) + { return ACE_FIFO_Send_Msg::open (ACE_TEXT_WCHAR_TO_CHAR (rendezvous), flags, perms, sa); } + +}; + + +#include "ace/post.h" +#endif /* ACE_ADAPTER_FIFO_SEND_MSG_H */ diff --git a/ace/adapter/ace/FILE_Addr.h b/ace/adapter/ace/FILE_Addr.h new file mode 100644 index 00000000000..28de2e3ceba --- /dev/null +++ b/ace/adapter/ace/FILE_Addr.h @@ -0,0 +1,57 @@ +// $Id$ + +#ifndef ACE_ADAPTER_FILE_ADDR_H +#define ACE_ADAPTER_FILE_ADDR_H +#include "ace/pre.h" + +#include "../../FILE_Addr.h" + +class ACE_FILE_Addr_W : public ACE_FILE_Addr +{ +public: + ACE_FILE_Addr_W (void) + {} + + ACE_FILE_Addr_W (const ACE_FILE_Addr_W &sa) + : ACE_FILE_Addr (sa) + {} + + int set (const ACE_FILE_Addr_W &sa) + { return ACE_FILE_Addr::set (sa); } + + ACE_EXPLICIT ACE_FILE_Addr_W (const wchar_t *filename) + : ACE_FILE_Addr (ACE_TEXT_WCHAR_TO_CHAR (filename)) + {} + + int set (const wchar_t *filename) + { return ACE_FILE_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (filename)); } + + ACE_FILE_Addr_W &operator= (const ACE_FILE_Addr_W &SAP) + { + ACE_FILE_Addr::operator= (SAP); + return *this; + } + + virtual int addr_to_string (wchar_t *addr, size_t size) const + { + char *caddr; + ACE_NEW_RETURN (caddr, char [size], -1); + + int result = ACE_FILE_Addr::addr_to_string (caddr, size); + ACE_OS::strcpy (addr, ACE_TEXT_CHAR_TO_WCHAR (caddr)); + delete [] caddr; + return result; + } + + int operator == (const ACE_FILE_Addr_W &SAP) const + { return ACE_FILE_Addr::operator== (SAP); } + + int operator != (const ACE_FILE_Addr_W &SAP) const + { return ACE_FILE_Addr::operator!= (SAP); } + + const wchar_t *get_path_name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_FILE_Addr::get_path_name ())); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_FILE_ADDR_H */ diff --git a/ace/adapter/ace/Functor.h b/ace/adapter/ace/Functor.h new file mode 100644 index 00000000000..6387ef9dd00 --- /dev/null +++ b/ace/adapter/ace/Functor.h @@ -0,0 +1,77 @@ +// $Id$ + +#ifndef ACE_ADAPTER_FUNCTOR_H +#define ACE_ADAPTER_FUNCTOR_H +#include "ace/pre.h" + +#include "../../Functor.h" + +ACE_TEMPLATE_SPECIALIZATION +class ACE_Hash +{ + // = TITLE + // Function object for hashing a const string +public: + u_long operator () (const wchar_t *t) const + { return ACE::hash_pjw (t); } +}; + +ACE_TEMPLATE_SPECIALIZATION +class ACE_Hash +{ + // = TITLE + // Function object for hashing a string +public: + u_long operator () (const wchar_t *t) const + { return ACE::hash_pjw (t); } +}; + +ACE_TEMPLATE_SPECIALIZATION +class ACE_Equal_To +{ + // = TITLE + // Function object for determining whether two const strings are equal. +public: + int operator () (const wchar_t *lhs, + const wchar_t *rhs) const + { return ACE_OS::strcmp (lhs, rhs) == 0; } +}; + +ACE_TEMPLATE_SPECIALIZATION +class ACE_Export ACE_Equal_To +{ + // = TITLE + // Function object for determining whether two non-const + // strings are equal. +public: + int operator () (const wchar_t *lhs, + const wchar_t *rhs) const + { return ACE_OS::strcmp (lhs, rhs) == 0; } +}; + +ACE_TEMPLATE_SPECIALIZATION +class ACE_Export ACE_Less_Than +{ + // = TITLE + // Function object for determining whether the first const string + // is less than the second const string. +public: + int operator () (const wchar_t *lhs, + const wchar_t *rhs) const + { return ACE_OS::strcmp (lhs, rhs) == 0; } +}; + +ACE_TEMPLATE_SPECIALIZATION +class ACE_Export ACE_Less_Than +{ + // = TITLE + // Function object for determining whether the first string + // is less than the second string. +public: + int operator () (const wchar_t *lhs, + const wchar_t *rhs) const + { return ACE_OS::strcmp (lhs, rhs) == 0; } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_FUNCTOR_H */ diff --git a/ace/adapter/ace/High_Res_Timer.h b/ace/adapter/ace/High_Res_Timer.h new file mode 100644 index 00000000000..0cb95d0d400 --- /dev/null +++ b/ace/adapter/ace/High_Res_Timer.h @@ -0,0 +1,37 @@ +// $Id$ + +#ifndef ACE_ADAPTER_HIGH_RES_TIMER_H +#define ACE_ADAPTER_HIGH_RES_TIMER_H +#include "ace/pre.h" + +#include "../../High_Res_Timer.h" + +class ACE_High_Res_Timer_W : public ACE_High_Res_Timer +{ +public: + static int get_env_global_scale_factor (const wchar_t *env + = L"ACE_SCALE_FACTOR") + { return ACE_High_Res_Timer::get_env_global_scale_factor (ACE_TEXT_WCHAR_TO_CHAR (env)); } + + ACE_High_Res_Timer_W (void) + {} + + ~ACE_High_Res_Timer_W (void) + {} + +#if !defined (ACE_HAS_WINCE) + void print_total (const wchar_t *message, + const int iterations = 1, + ACE_HANDLE handle = ACE_STDOUT) const + { ACE_High_Res_Timer::print_total (ACE_TEXT_WCHAR_TO_CHAR (message), iterations, handle); } + + void print_ave (const wchar_t *message, + const int iterations = 1, + ACE_HANDLE handle = ACE_STDOUT) const + { ACE_High_Res_Timer::print_ave (ACE_TEXT_WCHAR_TO_CHAR (message), iterations, handle); } +#endif /* !ACE_HAS_WINCE */ + +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_HIGH_RES_TIMER_H */ diff --git a/ace/adapter/ace/INET_Addr.h b/ace/adapter/ace/INET_Addr.h new file mode 100644 index 00000000000..052077e0b2b --- /dev/null +++ b/ace/adapter/ace/INET_Addr.h @@ -0,0 +1,117 @@ +// $Id$ + +#ifndef ACE_ADAPTER_INET_ADDR_H +#define ACE_ADAPTER_INET_ADDR_H +#include "ace/pre.h" + +#include "../../INET_Addr.h" + +class ACE_INET_Addr_W : public ACE_INET_Addr +{ +public: + ACE_INET_Addr_W (void) + {} + + ACE_INET_Addr_W (const ACE_INET_Addr &addr) + : ACE_INET_Addr (addr) + {} + + ACE_INET_Addr_W (const sockaddr_in *sa, int len) + : ACE_INET_Addr (sa, len) + {} + + ACE_INET_Addr_W (u_short port_number, + const wchar_t host_name[]) + : ACE_INET_Addr (port_number, ACE_TEXT_WCHAR_TO_CHAR (host_name)) + {} + + ACE_EXPLICIT ACE_INET_Addr_W (const wchar_t address[]) + : ACE_INET_Addr (ACE_TEXT_WCHAR_TO_CHAR (address)) + {} + + ACE_INET_Addr_W (u_short port_number, + ACE_UINT32 ip_addr = INADDR_ANY) + : ACE_INET_Addr (port_number, ip_addr) + {} + + ACE_INET_Addr_W (const wchar_t port_name[], + const wchar_t host_name[], + const wchar_t protocol[] = L"tcp") + : ACE_INET_Addr (ACE_TEXT_WCHAR_TO_CHAR (port_name), + ACE_TEXT_WCHAR_TO_CHAR (host_name), + ACE_TEXT_WCHAR_TO_CHAR (protocol)) + {} + + ACE_INET_Addr_W (const wchar_t port_name[], + ACE_UINT32 ip_addr, + const wchar_t protocol[] = L"tcp") + : ACE_INET_Addr (ACE_TEXT_WCHAR_TO_CHAR (port_name), + ip_addr, + ACE_TEXT_WCHAR_TO_CHAR (protocol)) + {} + + ~ACE_INET_Addr_W (void) + {} + + int set (u_short port_number, + const wchar_t host_name[], + int encode = 1) + { return ACE_INET_Addr::set (port_number, ACE_TEXT_WCHAR_TO_CHAR (host_name), encode); } + + int set (const wchar_t port_name[], + const wchar_t host_name[], + const wchar_t protocol[] = L"tcp") + { + return ACE_INET_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (port_name), + ACE_TEXT_WCHAR_TO_CHAR (host_name), + ACE_TEXT_WCHAR_TO_CHAR (protocol)); + } + + int set (const wchar_t port_name[], + ACE_UINT32 ip_addr, + const wchar_t protocol[] = L"tcp") + { + return ACE_INET_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (port_name), + ip_addr, + ACE_TEXT_WCHAR_TO_CHAR (protocol)); + } + + int set (const wchar_t addr[]) + { return ACE_INET_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (addr)); } + + virtual int addr_to_string (wchar_t buffer[], + size_t size, + int ipaddr_format = 1) const + { + char *cbuf; + ACE_NEW_RETURN (cbuf, char[size], -1); + + int result = ACE_INET_Addr::addr_to_string (cbuf, size, ipaddr_format); + ACE_OS::strcpy (buffer, ACE_TEXT_CHAR_TO_WCHAR (cbuf)); + delete [] cbuf; + return result; + } + + virtual int string_to_addr (const wchar_t address[]) + { return ACE_INET_Addr::string_to_addr (ACE_TEXT_WCHAR_TO_CHAR (address)); } + + int get_host_name (wchar_t hostname[], size_t hostnamelen) const + { + char *cbuf; + ACE_NEW_RETURN (cbuf, char[hostnamelen], -1); + + int result = ACE_INET_Addr::get_host_name (cbuf, hostnamelen); + ACE_OS::strcpy (hostname, ACE_TEXT_CHAR_TO_WCHAR (cbuf)); + delete [] cbuf; + return result; + } + + const wchar_t *get_host_name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_INET_Addr::get_host_name ())); } + + const wchar_t *get_host_addr (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_INET_Addr::get_host_addr ())); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_INET_ADDR_H */ diff --git a/ace/adapter/ace/MEM_Addr.h b/ace/adapter/ace/MEM_Addr.h new file mode 100644 index 00000000000..8469ea56ff9 --- /dev/null +++ b/ace/adapter/ace/MEM_Addr.h @@ -0,0 +1,80 @@ +// $Id$ + +#ifndef ACE_ADAPTER_MEM_ADDR_H +#define ACE_ADAPTER_MEM_ADDR_H +#include "ace/pre.h" + +#include "../../MEM_Addr.h" +#include "ace/ACE.h" + +class ACE_MEM_Addr_W : public ACE_MEM_Addr +{ +public: + ACE_MEM_Addr_W (void) + {} + + ACE_MEM_Addr_W (const ACE_MEM_Addr_W &sa) + : ACE_MEM_Addr (sa) + {} + + ACE_MEM_Addr_W (u_short port_number) + : ACE_MEM_Addr (port_number) + {} + + ACE_EXPLICIT ACE_MEM_Addr_W (const wchar_t port_name[]) + : ACE_MEM_Addr (ACE_TEXT_WCHAR_TO_CHAR (port_name)) + {} + + ~ACE_MEM_Addr_W (void) + {} + + int set (const wchar_t port_name[]) + { return ACE_MEM_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (port_name)); } + + virtual int addr_to_string (wchar_t buffer[], + size_t size, + int ipaddr_format = 1) const + { + char *cbuf; + ACE_NEW_RETURN (cbuf, char [size], -1); + + int result = ACE_MEM_Addr::addr_to_string (cbuf, size, ipaddr_format); + ACE_OS::strcpy (buffer, ACE_TEXT_CHAR_TO_WCHAR (cbuf)); + delete [] cbuf; + return result; + } + + virtual int string_to_addr (const wchar_t address[]) + { return ACE_MEM_Addr::string_to_addr (ACE_TEXT_WCHAR_TO_CHAR (address)); } + + int get_host_name (wchar_t hostname[], + size_t hostnamelen) const + { + char *cbuf; + ACE_NEW_RETURN (cbuf, char [hostnamelen], -1); + + int result = ACE_MEM_Addr::get_host_name (cbuf, hostnamelen); + ACE_OS::strcpy (hostname, ACE_TEXT_CHAR_TO_WCHAR (cbuf)); + delete [] cbuf; + return result; + } + + const wchar_t *get_host_name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_MEM_Addr::get_host_name ())); } + + const wchar_t *get_host_addr (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_MEM_Addr::get_host_addr ())); } + + int operator == (const ACE_MEM_Addr_W &SAP) const + { return ACE_MEM_Addr::operator== (SAP); } + int operator == (const ACE_INET_Addr &SAP) const + { return ACE_MEM_Addr::operator== (SAP); } + + int operator != (const ACE_MEM_Addr_W &SAP) const + { return ACE_MEM_Addr::operator!= (SAP); } + int operator != (const ACE_INET_Addr &SAP) const + { return ACE_MEM_Addr::operator!= (SAP); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_MEM_ADDR_H */ diff --git a/ace/adapter/ace/Malloc_T.h b/ace/adapter/ace/Malloc_T.h new file mode 100644 index 00000000000..c5b6b745be2 --- /dev/null +++ b/ace/adapter/ace/Malloc_T.h @@ -0,0 +1,90 @@ +// $Id$ + +#ifndef ACE_ADAPTER_MALLOC_T_H +#define ACE_ADAPTER_MALLOC_T_H +#include "ace/pre.h" + +#include "../../Malloc_T.h" + +template +class ACE_Allocator_Adapter_W : public ACE_Allocator_Adapter +{ +public: + ACE_Allocator_Adapter_W (const wchar_t *pool_name = 0) + : ACE_Allocator_Adapter (ACE_TEXT_WCHAR_TO_CHAR (pool_name)) + {} + + ACE_Allocator_Adapter_W (const wchar_t *pool_name, + const wchar_t *lock_name, + MEMORY_POOL_OPTIONS options = 0) + : ACE_Allocator_Adapter (ACE_TEXT_WCHAR_TO_CHAR (pool_name), + ACE_TEXT_WCHAR_TO_CHAR (lock_name), + options) + {} + + virtual ~ACE_Allocator_Adapter_W (void) + {} +}; + + +template +class ACE_Malloc_T_W : public ACE_Malloc_T +{ +public: + ACE_Malloc_T_W (const wchar_t *pool_name = 0) + : ACE_Malloc_T (ACE_TEXT_WCHAR_TO_CHAR (pool_name)) + {} + + ACE_Malloc_T_W (const wchar_t *pool_name, + const wchar_t *lock_name, + const ACE_MEM_POOL_OPTIONS *options = 0) + : ACE_Malloc_T (ACE_TEXT_WCHAR_TO_CHAR (pool_name), + ACE_TEXT_WCHAR_TO_CHAR (lock_name), + options); + {} + + +#if !defined (ACE_HAS_TEMPLATE_TYPEDEFS) + ACE_Malloc_T_W (const wchar_t *pool_name, + const wchar_t *lock_name, + const void *options = 0) + : ACE_Malloc_T (ACE_TEXT_WCHAR_TO_CHAR (pool_name), + ACE_TEXT_WCHAR_TO_CHAR (lock_name), + options); + {} +#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ + + ~ACE_Malloc_T_W (void) + {} +}; + + +template +class ACE_Malloc_W : public ACE_Malloc +{ +public: + ACE_Malloc_W (const wchar_t *pool_name = 0) + : ACE_Malloc (ACE_TEXT_WCHAR_TO_CHAR (pool_name)) + {} + + ACE_Malloc_W (const wchar_t *pool_name, + const wchar_t *lock_name, + const ACE_MEM_POOL_OPTIONS *options = 0) + : ACE_Malloc (ACE_TEXT_WCHAR_TO_CHAR (pool_name), + ACE_TEXT_WCHAR_TO_CHAR (lock_name), + options) + {} + +#if !defined (ACE_HAS_TEMPLATE_TYPEDEFS) + ACE_Malloc_W (const wchar_t *pool_name, + const wchar_t *lock_name, + const void *options = 0) + : ACE_Malloc (ACE_TEXT_WCHAR_TO_CHAR (pool_name), + ACE_TEXT_WCHAR_TO_CHAR (lock_name), + options) + {} +#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ +}; + +#include "ace/post.h" +#endif /* ACE_MALLOC_H */ diff --git a/ace/adapter/ace/Memory_Pool.h b/ace/adapter/ace/Memory_Pool.h new file mode 100644 index 00000000000..1fab15e7224 --- /dev/null +++ b/ace/adapter/ace/Memory_Pool.h @@ -0,0 +1,90 @@ +// $Id$ + +#ifndef ACE_ADAPTER_MEMORY_POOL_H +#define ACE_ADAPTER_MEMORY_POOL_H +#include "ace/pre.h" + +#include "../../Memory_Pool.h" + +#if !defined (ACE_LACKS_SBRK) + +class ACE_Sbrk_Memory_Pool_W : ACE_Sbrk_Memory_Pool +{ +public: + ACE_Sbrk_Memory_Pool_W (const wchar_t *backing_store_name = 0, + const OPTIONS *options = 0) + : ACE_Sbrk_Memory_Pool (ACE_TEXT_WCHAR_TO_CHAR (backing_store_name), options) + {} + + virtual ~ACE_Sbrk_Memory_Pool_W (void) + {} +} +#endif /* !ACE_LACKS_SBRK */ + +#if !defined (ACE_LACKS_SYSV_SHMEM) + +class ACE_Shared_Memory_Pool_W : public ACE_Shared_Memory_Pool +{ +public: + ACE_Shared_Memory_Pool_W (const wchar_t *backing_store_name = 0, + const OPTIONS *options = 0) + : ACE_Shared_Memory_Pool (ACE_TEXT_WCHAR_TO_CHAR (backing_store_name), options) + {} + + virtual ~ACE_Shared_Memory_Pool_W (void) + {} + +}; +#endif /* !ACE_LACKS_SYSV_SHMEM */ + +class ACE_Local_Memory_Pool_W : public ACE_Local_Memory_Pool +{ +public: + ACE_Local_Memory_Pool_W (const wchar_t *backing_store_name = 0, + const OPTIONS *options = 0) + : ACE_Local_Memory_Pool (ACE_TEXT_WCHAR_TO_CHAR (backing_store_name), options) + {} + + virtual ~ACE_Local_Memory_Pool_W (void) + {} +}; + +class ACE_MMAP_Memory_Pool_W : public ACE_MMAP_Memory_Pool +{ +public: + ACE_MMAP_Memory_Pool_W (const wchar_t *backing_store_name = 0, + const OPTIONS *options = 0) + : ACE_MMAP_Memory_Pool (ACE_TEXT_WCHAR_TO_CHAR (backing_store_name), options) + {} + + virtual ~ACE_MMAP_Memory_Pool_W (void) + {} +}; + +class ACE_Lite_MMAP_Memory_Pool_W : public ACE_Lite_MMAP_Memory_Pool +{ +public: + ACE_Lite_MMAP_Memory_Pool_W (const wchar_t *backing_store_name = 0, + const OPTIONS *options = 0) + : ACE_Lite_MMAP_Memory_Pool (ACE_TEXT_WCHAR_TO_CHAR (backing_store_name), options) + {} + + virtual ~ACE_Lite_MMAP_Memory_Pool_W (void) + {} +}; + +#if defined (ACE_WIN32) + +class ACE_Pagefile_Memory_Pool_W : public ACE_Pagefile_Memory_Pool +{ +public: + ACE_Pagefile_Memory_Pool_W (const wchar_t *backing_store_name = 0, + const OPTIONS *options = 0) + : ACE_Pagefile_Memory_Pool (ACE_TEXT_WCHAR_TO_CHAR (backing_store_name), options) + {} +}; + +#endif /* ACE_WIN32 */ + +#include "ace/post.h" +#endif /* ACE_ADAPTER_MEMORY_POOL_H */ diff --git a/ace/adapter/ace/OS.h b/ace/adapter/ace/OS.h new file mode 100644 index 00000000000..0caa6d1b308 --- /dev/null +++ b/ace/adapter/ace/OS.h @@ -0,0 +1,912 @@ +// $Id$ + +#ifndef ACE_ADAPTER_OS_H +#define ACE_ADAPTER_OS_H +#include "ace/pre.h" + +#include "../../OS.h" + +class ACE_OS_W : public ACE_OS +{ +public: +/* + // = A set of wrappers for miscellaneous operations. + static int atoi (const wchar_t *s); + + static ACE_TCHAR *getenv (const ACE_TCHAR *symbol); + static int putenv (const ACE_TCHAR *string); + static ACE_TCHAR *strenvdup (const ACE_TCHAR *str); + static ACE_TCHAR *getenvstrings (void); + + static int argv_to_string (ACE_TCHAR **argv, + ACE_TCHAR *&buf, + int substitute_env_args = 1); + static int string_to_argv (ACE_TCHAR *buf, + size_t &argc, + ACE_TCHAR **&argv, + int substitute_env_args = 1); + + // = A set of wrappers for condition variables. + static int condattr_init (ACE_condattr_t &attributes, + int type = ACE_DEFAULT_SYNCH_TYPE); + static int condattr_destroy (ACE_condattr_t &attributes); + static int cond_broadcast (ACE_cond_t *cv); + static int cond_destroy (ACE_cond_t *cv); + static int cond_init (ACE_cond_t *cv, + short type = ACE_DEFAULT_SYNCH_TYPE, + const ACE_TCHAR *name = 0, + void *arg = 0); + static int cond_init (ACE_cond_t *cv, + ACE_condattr_t &attributes, + const ACE_TCHAR *name = 0, + void *arg = 0); + static int cond_signal (ACE_cond_t *cv); + static int cond_timedwait (ACE_cond_t *cv, + ACE_mutex_t *m, + ACE_Time_Value *); + static int cond_wait (ACE_cond_t *cv, + ACE_mutex_t *m); + // = A set of wrappers for determining config info. + static ACE_TCHAR *cuserid (ACE_TCHAR *user, + size_t maxlen = 32); + static int uname (struct utsname *name); + static long sysinfo (int cmd, + char *buf, + long count); + static int hostname (ACE_TCHAR *name, + size_t maxnamelen); + + // = A set of wrappers for explicit dynamic linking. + static int dlclose (ACE_SHLIB_HANDLE handle); + + static ACE_TCHAR *dlerror (void); + static ACE_SHLIB_HANDLE dlopen (const ACE_TCHAR *filename, + int mode = ACE_DEFAULT_SHLIB_MODE); + static void *dlsym (ACE_SHLIB_HANDLE handle, + const ACE_TCHAR *symbol); + + static FILE *fopen (const ACE_TCHAR *filename, const ACE_TCHAR *mode); + static FILE *fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode); + static ACE_TCHAR *fgets (ACE_TCHAR *buf, int size, FILE *fp); + static int stat (const ACE_TCHAR *file, struct stat *); + static int truncate (const ACE_TCHAR *filename, off_t length); + + static void perror (const ACE_TCHAR *s); + + + // The old gets () which directly maps to the evil, unprotected + // gets () has been deprecated. If you really need gets (), + // consider the following one. + + // A better gets (). + // If n == 0, input is swallowed, but NULL is returned. + // Otherwise, reads up to n-1 bytes (not including the newline), + // then swallows rest up to newline + // then swallows newline + static char *gets (char *str, int n = 0); + static int puts (const ACE_TCHAR *s); + static int fputs (const ACE_TCHAR *s, + FILE *stream); + + static int fflush (FILE *fp); + static size_t fread (void *ptr, + size_t size, + size_t nelems, + FILE *fp); + static int fseek (FILE *fp, + long offset, + int ptrname); + static int fstat (ACE_HANDLE, + struct stat *); + static int lstat (const char *, + struct stat *); + static int ftruncate (ACE_HANDLE, + off_t); + static size_t fwrite (const void *ptr, + size_t size, + size_t nitems, + FILE *fp); + static void rewind (FILE *fp); + + // = Wrappers for searching and sorting. + static void *bsearch (const void *key, + const void *base, + size_t nel, + size_t size, + ACE_COMPARE_FUNC); + static void qsort (void *base, + size_t nel, + size_t width, + ACE_COMPARE_FUNC); + + // = A set of wrappers for file locks. + static int flock_init (ACE_OS::ace_flock_t *lock, + int flags = 0, + const ACE_TCHAR *name = 0, + mode_t perms = 0); + static int flock_destroy (ACE_OS::ace_flock_t *lock, + int unlink_file = 1); + static int flock_rdlock (ACE_OS::ace_flock_t *lock, + short whence = 0, + off_t start = 0, + off_t len = 0); + static int flock_tryrdlock (ACE_OS::ace_flock_t *lock, + short whence = 0, + off_t start = 0, + off_t len = 0); + static int flock_trywrlock (ACE_OS::ace_flock_t *lock, + short whence = 0, + off_t start = 0, + off_t len = 0); + static int flock_unlock (ACE_OS::ace_flock_t *lock, + short whence = 0, + off_t start = 0, + off_t len = 0); + static int flock_wrlock (ACE_OS::ace_flock_t *lock, + short whence = 0, + off_t start = 0, + off_t len = 0); + + // = A set of wrappers for low-level process operations. + static int atexit (ACE_EXIT_HOOK func); + static int execl (const char *path, + const char *arg0, ...); + static int execle (const char *path, + const char *arg0, ...); + static int execlp (const char *file, + const char *arg0, ...); + static int execv (const char *path, + char *const argv[]); + static int execvp (const char *file, + char *const argv[]); + static int execve (const char *path, + char *const argv[], + char *const envp[]); + static void _exit (int status = 0); + static void exit (int status = 0); + static void abort (void); + static pid_t fork (void); + static pid_t fork (const ACE_TCHAR *program_name); + static pid_t fork_exec (ACE_TCHAR *argv[]); + // Forks and exec's a process in a manner that works on Solaris and + // NT. argv[0] must be the full path name to the executable. + + static int getpagesize (void); + static int allocation_granularity (void); + + static gid_t getgid (void); + static int setgid (gid_t); + static pid_t getpid (void); + static pid_t getpgid (pid_t pid); + static pid_t getppid (void); + static uid_t getuid (void); + static int setuid (uid_t); + static pid_t setsid (void); + static int setpgid (pid_t pid, pid_t pgid); + static int setreuid (uid_t ruid, uid_t euid); + static int setregid (gid_t rgid, gid_t egid); + static int system (const ACE_TCHAR *s); + static pid_t waitpid (pid_t pid, + ACE_exitcode *status = 0, + int wait_options = 0, + ACE_HANDLE handle = 0); + // Calls <::waitpid> on UNIX/POSIX platforms and <::await> on + // Chorus. Does not work on Vxworks, or pSoS. + // On Win32, is ignored if the is not equal to 0. + // Passing the process is prefer on Win32 because using + // to wait on the project doesn't always work correctly + // if the waited process has already terminated. + static pid_t wait (pid_t pid, + ACE_exitcode *status, + int wait_options = 0, + ACE_HANDLE handle = 0); + // Calls <::WaitForSingleObject> on Win32 and + // otherwise. Returns the passed in on success and -1 on + // failure. + // On Win32, is ignored if the is not equal to 0. + // Passing the process is prefer on Win32 because using + // to wait on the project doesn't always work correctly + // if the waited process has already terminated. + static pid_t wait (int * = 0); + // Calls OS <::wait> function, so it's only portable to UNIX/POSIX + // platforms. + + // = A set of wrappers for timers and resource stats. + static u_int alarm (u_int secs); + static u_int ualarm (u_int usecs, + u_int interval = 0); + static u_int ualarm (const ACE_Time_Value &tv, + const ACE_Time_Value &tv_interval = ACE_Time_Value::zero); + static ACE_hrtime_t gethrtime (const ACE_HRTimer_Op = ACE_HRTIMER_GETTIME); + static int clock_gettime (clockid_t, + struct timespec *); + static ACE_Time_Value gettimeofday (void); + static int getrusage (int who, + struct rusage *rusage); + static int getrlimit (int resource, + struct rlimit *rl); + static int setrlimit (int resource, + ACE_SETRLIMIT_TYPE *rl); + static int sleep (u_int seconds); + static int sleep (const ACE_Time_Value &tv); + static int nanosleep (const struct timespec *requested, + struct timespec *remaining = 0); + + + static ACE_TCHAR *ctime_r (const time_t *clock, ACE_TCHAR *buf, int buflen); + static size_t strftime (char *s, + size_t maxsize, + const char *format, + const struct tm *timeptr); + + // = A set of wrappers for System V message queues. + static int msgctl (int msqid, + int cmd, + struct msqid_ds *); + static int msgget (key_t key, + int msgflg); + static int msgrcv (int int_id, + void *buf, + size_t len, + long type, + int flags); + static int msgsnd (int int_id, + const void *buf, + size_t len, + int flags); + + // = A set of wrappers for memory mapped files. + static int madvise (caddr_t addr, + size_t len, + int advice); + static void *mmap (void *addr, + size_t len, + int prot, + int flags, + ACE_HANDLE handle, + off_t off = 0, + ACE_HANDLE *file_mapping = 0, + LPSECURITY_ATTRIBUTES sa = 0); + static int mprotect (void *addr, + size_t len, + int prot); + static int msync (void *addr, + size_t len, + int sync); + static int munmap (void *addr, + size_t len); + + // = A set of wrappers for recursive mutex locks. + static int recursive_mutex_init (ACE_recursive_thread_mutex_t *m, + const ACE_TCHAR *name = 0, + ACE_mutexattr_t *arg = 0, + LPSECURITY_ATTRIBUTES sa = 0); + static int recursive_mutex_destroy (ACE_recursive_thread_mutex_t *m); + static int recursive_mutex_lock (ACE_recursive_thread_mutex_t *m); + static int recursive_mutex_trylock (ACE_recursive_thread_mutex_t *m); + static int recursive_mutex_unlock (ACE_recursive_thread_mutex_t *m); + + // = A set of wrappers for mutex locks. + static int mutex_init (ACE_mutex_t *m, + int type = ACE_DEFAULT_SYNCH_TYPE, + const ACE_TCHAR *name = 0, + ACE_mutexattr_t *arg = 0, + LPSECURITY_ATTRIBUTES sa = 0); + static int mutex_destroy (ACE_mutex_t *m); + static int mutex_lock (ACE_mutex_t *m); + // Win32 note: Abandoned mutexes are not treated differently. 0 is + // returned since the calling thread does get the ownership. + static int mutex_lock (ACE_mutex_t *m, + int &abandoned); + // This method is only implemented for Win32. For abandoned + // mutexes, is set to 1 and 0 is returned. + static int mutex_trylock (ACE_mutex_t *m); + // Win32 note: Abandoned mutexes are not treated differently. 0 is + // returned since the calling thread does get the ownership. + static int mutex_trylock (ACE_mutex_t *m, + int &abandoned); + // This method is only implemented for Win32. For abandoned + // mutexes, is set to 1 and 0 is returned. + static int mutex_unlock (ACE_mutex_t *m); + + // = A set of wrappers for mutex locks that only work within a + // single process. + static int thread_mutex_init (ACE_thread_mutex_t *m, + int type = ACE_DEFAULT_SYNCH_TYPE, + const ACE_TCHAR *name = 0, + ACE_mutexattr_t *arg = 0); + static int thread_mutex_destroy (ACE_thread_mutex_t *m); + static int thread_mutex_lock (ACE_thread_mutex_t *m); + static int thread_mutex_trylock (ACE_thread_mutex_t *m); + static int thread_mutex_unlock (ACE_thread_mutex_t *m); + + // = A set of wrappers for low-level file operations. + static int access (const ACE_TCHAR *path, int amode); + static int close (ACE_HANDLE handle); + static ACE_HANDLE creat (const ACE_TCHAR *filename, + mode_t mode); + static ACE_HANDLE dup (ACE_HANDLE handle); + static int dup2 (ACE_HANDLE oldfd, + ACE_HANDLE newfd); + static int fattach (int handle, + const char *path); + static long filesize (ACE_HANDLE handle); + static long filesize (const ACE_TCHAR *handle); + static int getmsg (ACE_HANDLE handle, + struct strbuf *ctl, + struct strbuf + *data, int *flags); + static int getpmsg (ACE_HANDLE handle, + struct strbuf *ctl, + struct strbuf + *data, + int *band, + int *flags); + static int ioctl (ACE_HANDLE handle, + int cmd, + void * = 0); + // UNIX-style . + static int ioctl (ACE_HANDLE socket, + u_long io_control_code, + void *in_buffer_p, + u_long in_buffer, + void *out_buffer_p, + u_long out_buffer, + u_long *bytes_returned, + ACE_OVERLAPPED *overlapped, + ACE_OVERLAPPED_COMPLETION_FUNC func); + // QoS-enabled . + static int ioctl (ACE_HANDLE socket, + u_long io_control_code, + ACE_QoS &ace_qos, + u_long *bytes_returned, + void *buffer_p = 0, + u_long buffer = 0, + ACE_OVERLAPPED *overlapped = 0, + ACE_OVERLAPPED_COMPLETION_FUNC func = 0); + // QoS-enabled when the I/O control code is either SIO_SET_QOS + // or SIO_GET_QOS. + static int isastream (ACE_HANDLE handle); + static int isatty (int handle); + static off_t lseek (ACE_HANDLE handle, + off_t offset, + int whence);*/ + + static ACE_HANDLE open (const wchar_t *filename, + int mode, + int perms = 0, + LPSECURITY_ATTRIBUTES sa = 0) + { return ACE_OS::open (ACE_TEXT_WCHAR_TO_CHAR (filename), mode, perms, sa); } + +/* + // Receive bytes into from (uses the + // call, which uses the system call on UNIX + // and the call on Win32). If errors occur, -1 is + // returned. If EOF occurs, 0 is returned. Whatever data has been + // transmitted will be returned to the caller through + // . + static int readlink (const char *path, + char *buf, + size_t bufsiz); + static ssize_t pread (ACE_HANDLE handle, + void *buf, + size_t nbyte, + off_t offset); + static int recvmsg (ACE_HANDLE handle, + struct msghdr *msg, + int flags); + static int sendmsg (ACE_HANDLE handle, + const struct msghdr *msg, + int flags); + static ssize_t write (ACE_HANDLE handle, + const void *buf, + size_t nbyte); + static ssize_t write (ACE_HANDLE handle, + const void *buf, + size_t nbyte, + ACE_OVERLAPPED *); + static ssize_t write_n (ACE_HANDLE handle, + const void *buf, + size_t len, + size_t *bytes_transferred = 0); + // Send bytes from to (uses the + // calls, which is uses the system call on UNIX and the + // call on Win32). If errors occur, -1 is returned. If + // EOF occurs, 0 is returned. Whatever data has been transmitted + // will be returned to the caller through . + static ssize_t pwrite (ACE_HANDLE handle, + const void *buf, + size_t nbyte, + off_t offset); + static ssize_t readv (ACE_HANDLE handle, + iovec *iov, + int iovlen); + static ssize_t writev (ACE_HANDLE handle, + const iovec *iov, + int iovcnt); + static ssize_t recvv (ACE_HANDLE handle, + iovec *iov, + int iovlen); + static ssize_t sendv (ACE_HANDLE handle, + const iovec *iov, + int iovcnt); + + // = A set of wrappers for event demultiplexing and IPC. + static int select (int width, + fd_set *rfds, + fd_set *wfds, + fd_set *efds, + const ACE_Time_Value *tv = 0); + static int select (int width, + fd_set *rfds, + fd_set *wfds, + fd_set *efds, + const ACE_Time_Value &tv); + static int poll (struct pollfd *pollfds, + u_long len, + ACE_Time_Value *tv = 0); + static int poll (struct pollfd *pollfds, + u_long len, + const ACE_Time_Value &tv); + static int pipe (ACE_HANDLE handles[]); + + static ACE_HANDLE shm_open (const ACE_TCHAR *filename, + int mode, + int perms = 0, + LPSECURITY_ATTRIBUTES sa = 0); + static int shm_unlink (const ACE_TCHAR *path); + + // = A set of wrappers for directory operations. + static mode_t umask (mode_t cmask); + static int chdir (const ACE_TCHAR *path); + static int mkdir (const ACE_TCHAR *path, + mode_t mode = ACE_DEFAULT_DIR_PERMS); + static int mkfifo (const ACE_TCHAR *file, + mode_t mode = ACE_DEFAULT_FILE_PERMS); + static ACE_TCHAR *mktemp (ACE_TCHAR *t); + static ACE_TCHAR *getcwd (ACE_TCHAR *, size_t); + static int rename (const ACE_TCHAR *old_name, + const ACE_TCHAR *new_name, + int flags = -1);*/ + + static int unlink (const wchar_t *path) + { return ACE_OS::unlink (ACE_TEXT_WCHAR_TO_CHAR (path)); } + + /* static ACE_TCHAR *tempnam (const ACE_TCHAR *dir = 0, + const ACE_TCHAR *pfx = 0); + + // = A set of wrappers for random number operations. + static int rand (void); + static int rand_r (ACE_RANDR_TYPE &seed); + static void srand (u_int seed); + + // = A set of wrappers for readers/writer locks. + static int rwlock_init (ACE_rwlock_t *rw, + int type = ACE_DEFAULT_SYNCH_TYPE, + const ACE_TCHAR *name = 0, + void *arg = 0); + static int rwlock_destroy (ACE_rwlock_t *rw); + static int rw_rdlock (ACE_rwlock_t *rw); + static int rw_wrlock (ACE_rwlock_t *rw); + static int rw_tryrdlock (ACE_rwlock_t *rw); + static int rw_trywrlock (ACE_rwlock_t *rw); + static int rw_trywrlock_upgrade (ACE_rwlock_t *rw); + static int rw_unlock (ACE_rwlock_t *rw); + + // = A set of wrappers for auto-reset and manuaevents. + static int event_init (ACE_event_t *event, + int manual_reset = 0, + int initial_state = 0, + int type = ACE_DEFAULT_SYNCH_TYPE, + const ACE_TCHAR *name = 0, + void *arg = 0, + LPSECURITY_ATTRIBUTES sa = 0); + static int event_destroy (ACE_event_t *event); + static int event_wait (ACE_event_t *event); + static int event_timedwait (ACE_event_t *event, + ACE_Time_Value *timeout); + static int event_signal (ACE_event_t *event); + static int event_pulse (ACE_event_t *event); + static int event_reset (ACE_event_t *event); + + // = A set of wrappers for semaphores. + static int sema_destroy (ACE_sema_t *s); + static int sema_init (ACE_sema_t *s, + u_int count, + int type = ACE_DEFAULT_SYNCH_TYPE, + const ACE_TCHAR *name = 0, + void *arg = 0, + int max = 0x7fffffff, + LPSECURITY_ATTRIBUTES sa = 0); + static int sema_post (ACE_sema_t *s); + static int sema_post (ACE_sema_t *s, + size_t release_count); + static int sema_trywait (ACE_sema_t *s); + static int sema_wait (ACE_sema_t *s); + static int sema_wait (ACE_sema_t *s, + ACE_Time_Value &tv); + + // = A set of wrappers for System V semaphores. + static int semctl (int int_id, + int semnum, + int cmd, + semun); + static int semget (key_t key, + int nsems, + int flags); + static int semop (int int_id, + struct sembuf *sops, + size_t nsops); + + // = Thread scheduler interface. + static int sched_params (const ACE_Sched_Params &, ACE_id_t id = ACE_SELF); + // Set scheduling parameters. An id of ACE_SELF indicates, e.g., + // set the parameters on the calling thread. + + // = A set of wrappers for System V shared memory. + static void *shmat (int int_id, + void *shmaddr, + int shmflg); + static int shmctl (int int_id, + int cmd, + struct shmid_ds *buf); + static int shmdt (void *shmaddr); + static int shmget (key_t key, + int size, + int flags); + + // = A set of wrappers for Signals. + static int kill (pid_t pid, + int signum); + static int sigaction (int signum, + const struct sigaction *nsa, + struct sigaction *osa); + static int sigaddset (sigset_t *s, + int signum); + static int sigdelset (sigset_t *s, + int signum); + static int sigemptyset (sigset_t *s); + static int sigfillset (sigset_t *s); + static int sigismember (sigset_t *s, + int signum); + static ACE_SignalHandler signal (int signum, + ACE_SignalHandler); + static int sigsuspend (const sigset_t *set); + static int sigprocmask (int how, + const sigset_t *nsp, + sigset_t *osp); + + static int pthread_sigmask (int how, + const sigset_t *nsp, + sigset_t *osp); + + // = A set of wrappers for sockets. + static ACE_HANDLE accept (ACE_HANDLE handle, + struct sockaddr *addr, + int *addrlen); + // BSD-style (no QoS). + static ACE_HANDLE accept (ACE_HANDLE handle, + struct sockaddr *addr, + int *addrlen, + const ACE_Accept_QoS_Params &qos_params); + // QoS-enabled , which passes to . If + // the OS platform doesn't support QoS-enabled then the + // are ignored and the BSD-style is called. + static int bind (ACE_HANDLE s, + struct sockaddr *name, + int namelen); + static int connect (ACE_HANDLE handle, + struct sockaddr *addr, + int addrlen); + // BSD-style (no QoS). + static int connect (ACE_HANDLE handle, + const sockaddr *addr, + int addrlen, + const ACE_QoS_Params &qos_params); + // QoS-enabled , which passes to . + // If the OS platform doesn't support QoS-enabled then the + // are ignored and the BSD-style is called. + + static int closesocket (ACE_HANDLE s); + static struct hostent *gethostbyaddr (const ACE_TCHAR *addr, + int length, + int type); + static struct hostent *gethostbyname (const ACE_TCHAR *name); + static struct hostent *gethostbyname2 (const ACE_TCHAR *name, int type); + static struct hostent *gethostbyaddr_r (const ACE_TCHAR *addr, + int length, + int type, + struct hostent *result, + ACE_HOSTENT_DATA buffer, + int *h_errnop); + static struct hostent *gethostbyname_r (const ACE_TCHAR *name, + struct hostent *result, + ACE_HOSTENT_DATA buffer, + int *h_errnop); + static int getpeername (ACE_HANDLE handle, + struct sockaddr *addr, + int *addrlen); + static struct protoent *getprotobyname (const ACE_TCHAR *name); + static struct protoent *getprotobyname_r (const ACE_TCHAR *name, + struct protoent *result, + ACE_PROTOENT_DATA buffer); + static struct protoent *getprotobynumber (int proto); + static struct protoent *getprotobynumber_r (int proto, + struct protoent *result, + ACE_PROTOENT_DATA buffer); + static struct servent *getservbyname (const ACE_TCHAR *svc, + const ACE_TCHAR *proto); + static struct servent *getservbyname_r (const ACE_TCHAR *svc, + const ACE_TCHAR *proto, + struct servent *result, + ACE_SERVENT_DATA buf); + static int getsockname (ACE_HANDLE handle, + struct sockaddr *addr, + int *addrlen); + static int getsockopt (ACE_HANDLE handle, + int level, + int optname, + char *optval, + int *optlen); + static long inet_addr (const ACE_TCHAR *name); + static ACE_TCHAR *inet_ntoa (const struct in_addr addr); + static int inet_aton (const ACE_TCHAR *strptr, + struct in_addr *addr); + static const ACE_TCHAR *inet_ntop (int family, + const void *addrptr, + ACE_TCHAR *strptr, + size_t len); + static int inet_pton (int family, + const ACE_TCHAR *strptr, + void *addrptr); + static int enum_protocols (int *protocols, + ACE_Protocol_Info *protocol_buffer, + u_long *buffer_length); + // Retrieve information about available transport protocols + // installed on the local machine. + static ACE_HANDLE join_leaf (ACE_HANDLE socket, + const sockaddr *name, + int namelen, + const ACE_QoS_Params &qos_params); + // Joins a leaf node into a QoS-enabled multi-point session. + static int listen (ACE_HANDLE handle, + int backlog); + static int recv (ACE_HANDLE handle, + char *buf, + int len, + int flags = 0); + static int recvfrom (ACE_HANDLE handle, + char *buf, + int len, + int flags, + struct sockaddr *addr, + int *addrlen); + static int recvfrom (ACE_HANDLE handle, + iovec *buffers, + int buffer_count, + size_t &number_of_bytes_recvd, + int &flags, + struct sockaddr *addr, + int *addrlen, + ACE_OVERLAPPED *overlapped, + ACE_OVERLAPPED_COMPLETION_FUNC func); + static int send (ACE_HANDLE handle, + const char *buf, + int len, + int flags = 0); + static int sendto (ACE_HANDLE handle, + const char *buf, + int len, + int flags, + const struct sockaddr *addr, + int addrlen); + static int sendto (ACE_HANDLE handle, + const iovec *buffers, + int buffer_count, + size_t &number_of_bytes_sent, + int flags, + const struct sockaddr *addr, + int addrlen, + ACE_OVERLAPPED *overlapped, + ACE_OVERLAPPED_COMPLETION_FUNC func); + static int setsockopt (ACE_HANDLE handle, + int level, + int optname, + const char *optval, + int optlen); + // QoS-enabled wrapper. + static int shutdown (ACE_HANDLE handle, + int how); + static ACE_HANDLE socket (int protocol_family, + int type, + int proto); + + // Create a BSD-style socket (no QoS). + static ACE_HANDLE socket (int protocol_family, + int type, + int proto, + ACE_Protocol_Info *protocolinfo, + ACE_SOCK_GROUP g, + u_long flags); + // Create a QoS-enabled socket. If the OS platform doesn't support + // QoS-enabled then the BSD-style is called. + + static int socketpair (int domain, + int type, + int protocol, + ACE_HANDLE sv[2]); + static int socket_init (int version_high = 1, + int version_low = 1); + // Initialize WinSock before first use (e.g., when a DLL is first + // loaded or the first use of a socket() call. + + static int socket_fini (void); + // Finalize WinSock after last use (e.g., when a DLL is unloaded). + + // = A set of wrappers for password routines. + static void setpwent (void); + static void endpwent (void); + static struct passwd *getpwent (void); + static struct passwd *getpwnam (const char *user); + static struct passwd *getpwnam_r (const char *name, + struct passwd *pwent, + char *buffer, + int buflen); + + // = A set of wrappers for regular expressions. + static char *compile (const char *instring, + char *expbuf, + char *endbuf); + static int step (const char *str, + char *expbuf); + + // @@ UNICODE: (brunsch) Can this be handled better? + // The following WChar typedef and functions are used by TAO. TAO + // does not use wchar_t because the size of wchar_t is + // platform-dependent. These are to be used for all + // manipulate\ions of CORBA::WString. + typedef ACE_UINT16 WChar; + static u_int wslen (const WChar *); + static WChar *wscpy (WChar *, + const WChar *); + static int wscmp (const WChar *, + const WChar *); + static int wsncmp (const WChar *, + const WChar *, + size_t len); + + // = A set of wrappers for threads + + // These are non-portable since they use ACE_thread_t and + // ACE_hthread_t and will go away in a future release. + static int thr_continue (ACE_hthread_t target_thread); + static int thr_create (ACE_THR_FUNC func, + void *args, + long flags, + ACE_thread_t *thr_id, + ACE_hthread_t *t_handle = 0, + long priority = ACE_DEFAULT_THREAD_PRIORITY, + void *stack = 0, + size_t stacksize = 0, + ACE_Thread_Adapter *thread_adapter = 0); + // Creates a new thread having attributes and running + // with (if is non-0 then and + // are ignored and are obtained from ). + // and are set to the thread's ID and handle (?), + // respectively. The thread runs at priority (see + // below). + // + // The are a bitwise-OR of the following: + // = BEGIN + // THR_CANCEL_DISABLE, THR_CANCEL_ENABLE, THR_CANCEL_DEFERRED, + // THR_CANCEL_ASYNCHRONOUS, THR_BOUND, THR_NEW_LWP, THR_DETACHED, + // THR_SUSPENDED, THR_DAEMON, THR_JOINABLE, THR_SCHED_FIFO, + // THR_SCHED_RR, THR_SCHED_DEFAULT + // = END + // + // By default, or if is set to + // ACE_DEFAULT_THREAD_PRIORITY, an "appropriate" priority value for + // the given scheduling policy (specified in , e.g., + // ) is used. This value is calculated + // dynamically, and is the median value between the minimum and + // maximum priority values for the given policy. If an explicit + // value is given, it is used. Note that actual priority values are + // EXTREMEMLY implementation-dependent, and are probably best + // avoided. + // + // Note that is always deleted by , + // therefore it must be allocated with global operator new. + + static int thr_getprio (ACE_hthread_t thr_id, + int &prio); + static int thr_join (ACE_hthread_t waiter_id, + void **status); + static int thr_join (ACE_thread_t waiter_id, + ACE_thread_t *thr_id, + void **status); + static int thr_kill (ACE_thread_t thr_id, + int signum); + static ACE_thread_t thr_self (void); + static void thr_self (ACE_hthread_t &); + static int thr_setprio (ACE_hthread_t thr_id, + int prio); + static int thr_setprio (const ACE_Sched_Priority prio); + static int thr_suspend (ACE_hthread_t target_thread); + static int thr_cancel (ACE_thread_t t_id); + + static int thr_cmp (ACE_hthread_t t1, + ACE_hthread_t t2); + static int thr_equal (ACE_thread_t t1, + ACE_thread_t t2); + static void thr_exit (void *status = 0); + static int thr_getconcurrency (void); + static int lwp_getparams (ACE_Sched_Params &); + static int thr_getspecific (ACE_thread_key_t key, + void **data); + static int thr_keyfree (ACE_thread_key_t key); + static int thr_key_detach (void *inst); + static int thr_key_used (ACE_thread_key_t key); + static size_t thr_min_stack (void); + static int thr_setconcurrency (int hint); + static int lwp_setparams (const ACE_Sched_Params &); + static int thr_setspecific (ACE_thread_key_t key, + void *data); + static int thr_sigsetmask (int how, + const sigset_t *nsm, + sigset_t *osm); + static int thr_setcancelstate (int new_state, + int *old_state); + static int thr_setcanceltype (int new_type, + int *old_type); + static int sigwait (sigset_t *set, + int *sig = 0); + static int sigtimedwait (const sigset_t *set, + siginfo_t *info, + const ACE_Time_Value *timeout); + static void thr_testcancel (void); + static void thr_yield (void); + + static void unique_name (const void *object, + ACE_TCHAR *name, + size_t length); + // This method uses process id and object pointer to come up with a + // machine wide unique name. The process ID will provide uniqueness + // between processes on the same machine. The "this" pointer of the + // will provide uniqueness between other "live" objects in + // the same process. The uniqueness of this name is therefore only + // valid for the life of . + + static ACE_thread_t NULL_thread; + // This is necessary to deal with POSIX pthreads and their use of + // structures for thread ids. + + static ACE_hthread_t NULL_hthread; + // This is necessary to deal with POSIX pthreads and their use of + // structures for thread handles. + + static ACE_thread_key_t NULL_key; + // This is necessary to deal with POSIX pthreads and their use of + // structures for TSS keys. + + static void mutex_lock_cleanup (void *mutex); + // Handle asynchronous thread cancellation cleanup. + + static void cleanup_tss (const u_int main_thread); + // Call TSS destructors for the current thread. If the current + // thread is the main thread, then the argument must be 1. + // For private use of ACE_Object_Manager and ACE_Thread_Adapter only. + + static int scheduling_class (const char *class_name, ACE_id_t &); + // Find the schedling class ID that corresponds to the class name. + + static int set_scheduling_params (const ACE_Sched_Params &, + ACE_id_t id = ACE_SELF); + // Friendly interface to (2). + + // Can't call the following priocntl, because that's a macro on Solaris. + static int priority_control (ACE_idtype_t, ACE_id_t, int, void *); + // Low-level interface to (2).*/ +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_OS_H */ diff --git a/ace/adapter/ace/OS_Dirent.h b/ace/adapter/ace/OS_Dirent.h new file mode 100644 index 00000000000..2749e26110e --- /dev/null +++ b/ace/adapter/ace/OS_Dirent.h @@ -0,0 +1,17 @@ +// $Id$ + +#ifndef ACE_ADAPTER_OS_DIRENT_H +#define ACE_ADAPTER_OS_DIRENT_H +#include "ace/pre.h" + +#include "../../OS_Dirent.h" + +class ACE_OS_Dirent_W : public ACE_OS_Dirent +{ +public: + static DIR *opendir (const wchar_t *filename) + { return ACE_OS_Dirent::opendir (ACE_TEXT_WCHAR_TO_CHAR (filename)); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_OS_DIRENT_H */ diff --git a/ace/adapter/ace/OS_String.h b/ace/adapter/ace/OS_String.h new file mode 100644 index 00000000000..f125060640c --- /dev/null +++ b/ace/adapter/ace/OS_String.h @@ -0,0 +1,44 @@ +// $Id$ + +#ifndef ACE_ADAPTER_OS_STRING_H +#define ACE_ADAPTER_OS_STRING_H +#include "ace/pre.h" + +#include "../../ace_wchar.h" +#include "../../OS_String.h" + +#if defined (ACE_HAS_WCHAR) + +#if defined (ACE_USES_WCHAR) + +class ACE_OS_String_C : public ACE_OS_String +{ +public: + static int ace_isspace (const wchar_t s); + static int ace_isprint (const wchar_t s); + +}; + +typedef ACE_OS_String_W ACE_OS_String; + +#else /* ACE_USES_WCHAR */ + +typedef ACE_OS_String ACE_OS_String_C; + +class ACE_OS_String_W : public ACE_OS_String +{ +public: + static int ace_isspace (const wchar_t s); + static int ace_isprint (const wchar_t s); + +}; + +#endif /* ACE_USES_WCHAR */ +#else /* ACE_HAS_WCHAR */ + +typedef ACE_OS_String_C ACE_OS_String; + +#endif /* ACE_HAS_WCHAR */ + +#include "ace/post.h" +#endif /* ACE_ADAPTER_OS_STRING_H */ diff --git a/ace/adapter/ace/SOCK_Dgram_Bcast.h b/ace/adapter/ace/SOCK_Dgram_Bcast.h new file mode 100644 index 00000000000..bc24d9d0182 --- /dev/null +++ b/ace/adapter/ace/SOCK_Dgram_Bcast.h @@ -0,0 +1,35 @@ +// $Id$ + +#ifndef ACE_ADAPTER_SOCK_DGRAM_BCAST_H +#define ACE_ADAPTER_SOCK_DGRAM_BCAST_H +#include "ace/pre.h" + +#include "../../SOCK_Dgram_Bcast.h" + +class ACE_SOCK_Dgram_Bcast_W : public ACE_SOCK_Dgram_Bcast +{ +public: + ACE_SOCK_Dgram_Bcast_W (void) + {} + + ACE_SOCK_Dgram_Bcast_W (const ACE_Addr &local, + int protocol_family = PF_INET, + int protocol = 0, + int reuse_addr = 0, + const wchar_t *host_name = 0) + : ACE_SOCK_Dgram_Bcast (local, protocol_family, protocol, reuse_addr, ACE_TEXT_WCHAR_TO_CHAR (host_name)) + {} + + ~ACE_SOCK_Dgram_Bcast_W (void) + {} + + int open (const ACE_Addr &local, + int protocol_family = PF_INET, + int protocol = 0, + int reuse_addr = 0, + const wchar_t *host_name = 0) + { return ACE_SOCK_Dgram_Bcast::open (local, protocol_family, protocol, reuse_addr, ACE_TEXT_WCHAR_TO_CHAR (host_name)); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SOCK_DGRAM_BCAST_H */ diff --git a/ace/adapter/ace/SOCK_Dgram_Mcast.h b/ace/adapter/ace/SOCK_Dgram_Mcast.h new file mode 100644 index 00000000000..4204cd6b406 --- /dev/null +++ b/ace/adapter/ace/SOCK_Dgram_Mcast.h @@ -0,0 +1,45 @@ +// $Id$ + +#ifndef ACE_ADAPTER_SOCK_DGRAM_MCAST_H +#define ACE_ADAPTER_SOCK_DGRAM_MCAST_H +#include "ace/pre.h" + +#include "../../SOCK_Dgram_Mcast.h" + +class ACE_SOCK_Dgram_Mcast_W : public ACE_SOCK_Dgram_Mcast +{ +public: + ACE_SOCK_Dgram_Mcast_W (void) + {} + + ~ACE_SOCK_Dgram_Mcast_W (void) + {} + + int subscribe (const ACE_INET_Addr &mcast_addr, + int reuse_addr = 1, + const wchar_t *net_if = 0, + int protocol_family = PF_INET, + int protocol = 0) + { + return ACE_SOCK_Dgram_Mcast::subscribe (mcast_addr, + reuse_addr, + ACE_TEXT_WCHAR_TO_CHAR (net_if), + protocol_family, + protocol); + } + + int unsubscribe (const ACE_INET_Addr &mcast_addr, + const wchar_t *net_if = 0, + int protocol_family = PF_INET, + int protocol = 0) + { + return ACE_SOCK_Dgram_Mcast::unsubscribe (mcast_addr, + ACE_TEXT_WCHAR_TO_CHAR (net_if), + protocol_family, + protocol); + } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SOCK_DGRAM_MCAST_H */ + diff --git a/ace/adapter/ace/SOCK_Dgram_Mcast_QoS.h b/ace/adapter/ace/SOCK_Dgram_Mcast_QoS.h new file mode 100644 index 00000000000..a32ca2b7563 --- /dev/null +++ b/ace/adapter/ace/SOCK_Dgram_Mcast_QoS.h @@ -0,0 +1,49 @@ +/* -*- C++ -*- */ +// $Id$ + +#ifndef ACE_ADAPTER_SOCK_DGRAM_MCAST_QOS_H +#define ACE_ADAPTER_SOCK_DGRAM_MCAST_QOS_H +#include "ace/pre.h" + +#include "../../SOCK_Dgram_Mcast_QoS.h" + +class ACE_SOCK_Dgram_Mcast_QoS_W : public ACE_SOCK_Dgram_Mcast_QoS +{ +public: + ACE_SOCK_Dgram_Mcast_QoS_W (void) + {} + + ~ACE_SOCK_Dgram_Mcast_QoS_W (void) + {} + + int subscribe (const ACE_INET_Addr &mcast_addr, + const ACE_QoS_Params &qos_params, + int reuse_addr = 1, + const wchar_t *net_if = 0, + int protocol_family = PF_INET, + int protocol = 0, + ACE_Protocol_Info *protocolinfo = 0, + ACE_SOCK_GROUP g = 0, + u_long flags = 0, + ACE_QoS_Manager *qos_manager = 0, + ACE_QoS_Session *qos_session = 0) + { + return ACE_SOCK_Dgram_Mcast_QoS::subscribe (mcast_addr, + qos_params, + reuse_addr, + ACE_TEXT_WCHAR_TO_CHAR (net_if), + protocol_family, + protocol, + protocolinfo, + g, + flags, + qos_manager, + qos_session); + } + +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SOCK_DGRAM_MCAST_QOS_H */ + + diff --git a/ace/adapter/ace/SPIPE_Addr.h b/ace/adapter/ace/SPIPE_Addr.h new file mode 100644 index 00000000000..b5c0c1ceb21 --- /dev/null +++ b/ace/adapter/ace/SPIPE_Addr.h @@ -0,0 +1,56 @@ +// $Id$ + +#ifndef ACE_ADAPTER_SPIPE_ADDR_H +#define ACE_ADAPTER_SPIPE_ADDR_H +#include "ace/pre.h" + +#include "../../SPIPE_Addr.h" + +class ACE_SPIPE_Addr_W : public ACE_SPIPE_Addr +{ +public: + ACE_SPIPE_Addr_W (void) + {} + + ACE_SPIPE_Addr_W (const ACE_SPIPE_Addr_W &sa) + : ACE_SPIPE_Addr (sa) + {} + + ACE_SPIPE_Addr_W (const wchar_t *rendezvous_point, gid_t g = 0, uid_t u = 0) + : ACE_SPIPE_Addr (ACE_TEXT_WCHAR_TO_CHAR (rendezvous_point), g, u) + {} + + int set (const ACE_SPIPE_Addr_W &sa) + { return ACE_SPIPE_Addr::set (sa); } + + int set (const wchar_t *rendezvous_point, gid_t g = 0, uid_t u = 0) + { return ACE_SPIPE_Addr::set (ACE_TEXT_WCHAR_TO_CHAR (rendezvous_point), g, u); } + + virtual int addr_to_string (wchar_t *addr, size_t size) const + { + char *caddr; + ACE_NEW_RETURN (caddr, char [size], -1); + + int result = ACE_SPIPE_Addr::addr_to_string (caddr, size); + + ACE_OS::strcpy (addr, ACE_TEXT_CHAR_TO_WCHAR (caddr)); + delete [] caddr; + return result; + } + + virtual int string_to_addr (const wchar_t *addr) + { return ACE_SPIPE_Addr::string_to_addr (ACE_TEXT_WCHAR_TO_CHAR (addr)); } + + // = Equality/inequality tests + int operator == (const ACE_SPIPE_Addr_W &SAP) const + { return ACE_SPIPE_Addr::operator== (SAP); } + + int operator != (const ACE_SPIPE_Addr_W &SAP) const + { return ACE_SPIPE_Addr::operator!= (SAP); } + + const wchar_t *get_path_name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_SPIPE_Addr::get_path_name ())); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SPIPE_ADDR_H */ diff --git a/ace/adapter/ace/Service_Config.h b/ace/adapter/ace/Service_Config.h new file mode 100644 index 00000000000..f274d4f8f8c --- /dev/null +++ b/ace/adapter/ace/Service_Config.h @@ -0,0 +1,87 @@ +// $Id$ + +#ifndef ACE_ADAPTER_SERVICE_CONFIG_H +#define ACE_ADAPTER_SERVICE_CONFIG_H +#include "ace/pre.h" + +#include "../../Service_Config.h" + +#if !defined (ACE_DEFAULT_LOGGER_KEY_W) +# if defined (ACE_HAS_STREAM_PIPES) +# define ACE_DEFAULT_LOGGER_KEY_W L"/tmp/server_daemon" +# else +# define ACE_DEFAULT_LOGGER_KEY_W L"localhost:10012" +# endif /* ACE_HAS_STREAM_PIPES */ +#endif /* ACE_DEFAULT_LOGGER_KEY */ + +class ACE_Service_Config_W : public ACE_Service_Config +{ +public: + + ACE_Service_Config_W (int ignore_static_svcs = 1, + size_t size = ACE_Service_Config_W::MAX_SERVICES, + int signum = SIGHUP) + : ACE_Service_Config (ignore_static_svcs, size, signum) + {} + + ACE_Service_Config_W (const wchar_t program_name[], + const wchar_t *logger_key = ACE_DEFAULT_LOGGER_KEY_W) + : ACE_Service_Config (ACE_TEXT_WCHAR_TO_CHAR (program_name), ACE_TEXT_WCHAR_TO_CHAR (logger_key)) + {} + + static int open_i (const wchar_t program_name[], + const wchar_t *logger_key = ACE_DEFAULT_LOGGER_KEY_W, + int ignore_default_svc_conf_file = 0, + int ignore_debug_flag = 0) + { + return ACE_Service_Config::open_i (ACE_TEXT_WCHAR_TO_CHAR (program_name), + ACE_TEXT_WCHAR_TO_CHAR (logger_key), + ignore_default_svc_conf_file, + ignore_debug_flag); + } + + static int open (const wchar_t program_name[], + const wchar_t *logger_key = ACE_DEFAULT_LOGGER_KEY_W, + int ignore_static_svcs = 1, + int ignore_default_svc_conf_file = 0, + int ignore_debug_flag = 0) + { + return ACE_Service_Config::open (ACE_TEXT_WCHAR_TO_CHAR (program_name), + ACE_TEXT_WCHAR_TO_CHAR (logger_key), + ignore_static_svcs, + ignore_default_svc_conf_file, + ignore_debug_flag); + } + + // @@ Implement: static int open (int argc, + // wchar_t *argv[], + // const wchar_t *logger_key = ACE_DEFAULT_LOGGER_KEY_W, + // int ignore_static_svcs = 1, + // int ignore_default_svc_conf = 0, + // int ignore_debug_flag = 0); + + virtual ~ACE_Service_Config_W (void) + {} + + // @@ Implement: static int initialize (const ACE_Service_Type *, wchar_t parameters[]); + + // @@ Implement: static int initialize (const wchar_t svc_name[], wchar_t parameters[]) + + static int resume (const wchar_t svc_name[]) + { return ACE_Service_Config::resume (ACE_TEXT_WCHAR_TO_CHAR (svc_name)); } + + static int suspend (const wchar_t svc_name[]) + { return ACE_Service_Config::suspend (ACE_TEXT_WCHAR_TO_CHAR (svc_name)); } + + static int remove (const wchar_t svc_name[]) + { return ACE_Service_Config::remove (ACE_TEXT_WCHAR_TO_CHAR (svc_name)); } + + static int process_directive (const wchar_t directive[]) + { return ACE_Service_Config::process_directive(ACE_TEXT_WCHAR_TO_CHAR (directive)); } + +protected: + // @@ Implement: static int parse_args (int, wchar_t *argv[]) +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SERVICE_CONFIG_H */ diff --git a/ace/adapter/ace/Service_Object.h b/ace/adapter/ace/Service_Object.h new file mode 100644 index 00000000000..b32df923815 --- /dev/null +++ b/ace/adapter/ace/Service_Object.h @@ -0,0 +1,30 @@ +// $Id$ + +#ifndef ACE_ADAPTER_SERVICE_OBJECT_H +#define ACE_ADAPTER_SERVICE_OBJECT_H +#include "ace/pre.h" + +#include "../../Service_Object.h" + +class ACE_Service_Type_W : public ACE_Service_Type +{ +public: + ACE_Service_Type_W (const wchar_t *n, + ACE_Service_Type_Impl *o, + const ACE_SHLIB_HANDLE handle, + int active) + : ACE_Service_Type (ACE_TEXT_WCHAR_TO_CHAR (n), o, handle, active) + {} + + ~ACE_Service_Type_W (void) + {} + + const wchar_t *name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_Service_Type::name ())); } + + void name (const wchar_t *name) + { ACE_Service_Type::name (ACE_TEXT_WCHAR_TO_CHAR (name)); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SERVICE_OBJECT_H */ diff --git a/ace/adapter/ace/Stats.h b/ace/adapter/ace/Stats.h new file mode 100644 index 00000000000..e306ecba5bb --- /dev/null +++ b/ace/adapter/ace/Stats.h @@ -0,0 +1,20 @@ +// $Id$ + +#ifndef ACE_ADAPTER_STATS_H +#define ACE_ADAPTER_STATS_H +#include "ace/pre.h" + +#include "../../Stats.h" + +class ACE_Throughput_Stats_W : public ACE_Throughput_Stats +{ +public: + ACE_Throughput_Stats_W (void) + {} + + void dump_results (const wchar_t *msg, ACE_UINT32 scale_factor) + { ACE_Throughput_Stats::dump_results (ACE_TEXT_WCHAR_TO_CHAR (msg), scale_factor); } +}; + +#include "ace/post.h" +#endif /* ! ACE_ADAPTER_STATS_H */ diff --git a/ace/adapter/ace/System_Time.h b/ace/adapter/ace/System_Time.h new file mode 100644 index 00000000000..3557b4493a8 --- /dev/null +++ b/ace/adapter/ace/System_Time.h @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef ACE_ADAPTER_SYSTEM_TIME_H +#define ACE_ADAPTER_SYSTEM_TIME_H +#include "ace/pre.h" + +#include "../../System_Time.h" + +class ACE_System_Time_W : public ACE_System_Time +{ +public: + ACE_System_Time_W (const wchar_t *poolname = 0) + : ACE_System_Time (ACE_TEXT_WCHAR_TO_CHAR (poolname)) + {} + + ~ACE_System_Time_W (void) + {} +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_SYSTEM_TIME_H */ diff --git a/ace/adapter/ace/Task_T.h b/ace/adapter/ace/Task_T.h new file mode 100644 index 00000000000..9c92befc1b1 --- /dev/null +++ b/ace/adapter/ace/Task_T.h @@ -0,0 +1,25 @@ +// $Id$ + +#ifndef ACE_ADAPTER_TASK_T_H +#define ACE_ADAPTER_TASK_T_H +#include "ace/pre.h" + +#include "../../Task_T.h" + +template +class ACE_Task_W : public ACE_Task +{ + ACE_Task_W (ACE_Thread_Manager *thr_mgr = 0, + ACE_Message_Queue *mq = 0) + : ACE_Task (thr_mgr, mq) + {} + + virtual ~ACE_Task_W (void) + {} + + const wchar_t *name (void) const + { return ACE::strnew (ACE_TEXT_CHAR_TO_WCHAR (ACE_Task::name ())); } +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_TASK_T_H */ diff --git a/ace/adapter/ace/Trace.h b/ace/adapter/ace/Trace.h new file mode 100644 index 00000000000..94f01e709f1 --- /dev/null +++ b/ace/adapter/ace/Trace.h @@ -0,0 +1,24 @@ +// $Id$ + +#ifndef ACE_ADAPTER_TRACE_H +#define ACE_ADAPTER_TRACE_H +#include "ace/pre.h" + +#include "../../Trace.h" + +class ACE_Trace_W : public ACE_Trace +{ +public: + ACE_Trace_W (const wchar_t *n, + int line = 0, + const wchar_t *file = L"") + : ACE_Trace (ACE_TEXT_WCHAR_TO_CHAR (n), line, ACE_TEXT_WCHAR_TO_CHAR (file)) + {} + + + ~ACE_Trace_W (void) + {} +}; + +#include "ace/post.h" +#endif /* ACE_ADAPTER_TRACE_H */ -- cgit v1.2.1